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
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