Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 Q2. MediaDocument
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
Q2. MediaDocument an abstract class) Implement a class, called MediaDocument, to represent the characteristics that are common to all the media documents. All the media documents have a method int getRating0, however the implementation of the method is specific to the kind of document. 1. A MediaDocument is a specialised kind of Document. Therefore, it must be a subclass of Document 2. All media documents have a duration (of type int) 3. The class MediaDocument has a single constructor. Its signature is as follows: public MediaDocument(String name, String owner, int duration It initialises the characteristics that are common to all Documents, as well as the duration Q3. Movie A Movie is a specialised MediaDocument that also has information about the rating of the story and acting. More precisely, l. A Movie is a (concrete) subclass of MediaDocument; 2. It also stores information about the rating of the story and the acting (both of type int). This information (two numbers in the range 1 10) is given as an argument to the constructor; 3. It has a single constructor and here is its signature: public Movie String name, String owner, int duration, int story, int acting). It serves to initialise all the characteristics that are common to all media documents, as well as the story and acting ratings. You can assume that the numbers, ratings, are valid, 4. public int getStoryRating0: returns the story rating; 5. public int getActingRating0: returns the acting rating; 6. It implements the method public int getRating0, which returns the average of the story and acting ratings rounded to the nearest integer
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started