Question: In Java This program introduces the concept of inheritance by creating subclasses of a Movie class. The program should have two classes: MoviesClass.java MoviesMainClass.java Create

In Java

This program introduces the concept of inheritance by creating subclasses of a Movie class.

The program should have two classes: MoviesClass.java MoviesMainClass.java

Create a class named MoviesClass.

TheMoviesClass class should track the Motion Picture Association of America (MPAA) rating (e.g., Rated G, PG-13, R, etc.), ID Number, and movie title with appropriate accessor and mutator methods.

Inside the MovieClass create an equals( ) method that overrides MovieClass equals ( ) method, such that two movies are equal if their ID number is identical.

Inside the MovieClass create three additional movie rating type classes named:

ActionMovie ComedyMovie DramaMovie

that are derived from Movie. Create an overridden method named calcLateFees that takes as input the number of days a movie is late and returns

the late fee for that movie rating type.

Create a method called toString() that displays all the movie object values and states in a well formatted manner. The following are the late fees for movie rating types:

Default

$2.00/day

Action

$3.00/day

Comedies

$2.50/day

Dramas

$2.00/day.

Test your classes from a main method.

The main class must include driver code that tests all the objects paths. The driver code in the main class should not be prompted based.

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!