Sale!

CMPS 258 WEEK 7 ASSIGNMENT– PART 2 solved

Original price was: $35.00.Current price is: $30.00. $25.50

Category:

Description

5/5 - (6 votes)

You have been provided with a Main.java file that implements two classes Audio and Video that
represent two different types of playable objects. Both classes contain a method playbackTime that
returns how long it takes to listen to the audio object or watch the video object. You are to implement
polymorphic class methods in the class Main that manipulate these objects. Make sure to use the most
general type of polymorphism for implementing each method. It is okay if the method works in other
scenarios, as long as it works in the scenarios specified.
You are not allowed to add or modify fields and methods in the Audio and Video classes, but you are
allowed to modify the class declarations if you need to. The code also contains test code in the main
function that is expected to work for a correct solution. Do not modify this test code.
1. Implement a polymorphic function selectRandom that takes a List