Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases A Beginners Guide

Authors: Andy Oppel

1st Edition

007160846X, 978-0071608466

More Books

Students also viewed these Databases questions

Question

7. Senior management supports the career system.

Answered: 1 week ago