Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN JAVA PLEASE. Create a class named Movie that can be used with your video rental business. The Movie class should track the Motion Picture

IN JAVA PLEASE.

Create a class named Movie that can be used with your video rental business. The Movie class should track the Motion Picture Association of America (MPAA) rating (e.g., Rated G, PG-13, R), ID Number, and movie title with appropriate accessor and mutator methods. Also create an equals() method that overrides Objects equals() method, where two movies are equal if their ID number is identical. Next, create three additional classes named Action , Comedy , and Drama that are derived from Movie. Finally, 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. The default late fee is $2/day. Action movies have a late fee of $3/day, comedies are $2.50/day, and dramas are $2/day.

You will create four java files Movie.java, Action.java, Comedy.java, and Drama.java. Here, Action, Comedy, and Drama classes are derived from Movie class.

Create another class called Rental (Rental.java). This class should store a Movie that is rented, an integer representing the ID of the customer that rented the movie, and an integer indicating how many days late the movie is. Add a method that calculates the late fees for rental.

In the main method, create an array (choose size of at least 10) that can hold objects of Rental class. Fill the array with objects of Rental class. Make sure the rental objects in the array are from different types of movies (Action, Comedy, Drama). Also make some of the rental objects in the array to be late. Now iterate through the array to calculate the following:

Number of rental objects that belong to Action movie type.

Number of rental objects that belong to Drama movie type.

Number of rental objects that belong to Comedy movie type.

Number of rental objects, which are late.

Total amount of late fees.

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

Lords Of Finance The Bankers Who Broke The World

Authors: Liaquat Ahamed

1st Edition

0143116800, 978-0143116806

Students also viewed these Databases questions