CMPS 258 –WEEK 7 ASSIGNMENT solved

$30.00

Category: You will Instantly receive a download link for .zip solution file upon Payment || To Order Original Work Click Custom Order?

Description

5/5 - (5 votes)

– PART 2 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