Question: java problems. q1, q2,q3,q4, and q5 are related. I can't put all questions together so please do all 5 questions by one person Q4. Audio

java problems. q1, q2,q3,q4, and q5 are related. I can't put alljava problems. q1, q2,q3,q4, and q5 are related. I can't put all questions together so please do all 5 questions by one person

Q4. Audio Audio is a specialised MediaDocument that also has information about the rating of this Audio document. More precisely 1. Audio is a (concrete) subclass of MediaDocument; 2. It stores the rating an int) of this document. The rating of an Audio document is a single number, the overall appreciation of the piece; 3. It has a single constructor. Its signature is public Audio( String name, String owner, int duration, int rating). It initialises the properties that are common to all media documents,a s well as the rating of this document 4. It implements the method public int get Ratingo, which returns the rating of this document In the case of an Audio document, the rating is a single number, therefore, the method simply returns this number In a real-world" application, the documents would contains additional attributes and methods (at least some content!). However, in the context of this laboratory, we will limit ourselves to those attributes and methods. Q5. Test Create a test program. In the main method, declare an array to store MediaDocument objects Fill the array with Movie and Audio documents. Finally, write a loop that calculates the sum of all the ratings. Additional exercise: Implement a method int getRating0 in the class Document that always returns a 0. In your Test program, create different reference variables of different classes and assign them to objects of different classes (documents, Movie,etc). Use these references to call the method getRatingo. Verify in each case which method is called (using which class) Output Files Document java Media Document java Movie java Audio java Test.java

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!