Purchase Solution

Java: Movie Rental Classes for a Video Rental Business

Not what you're looking for?

Ask Custom Question

Create a class named Movie that can be used with a 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 Object's 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 class 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 $2.50/day, and dramas $2/day. Test above classes using a main method.

Extend above with a Rental class. This class should store a Movie that is rented, an integer representing the ID of the customer who rented the movie, and an integer indicating how many days late the movie is. Add a method that calculates the late fee for the rental. In the main method create an array of type Rental, filled with sample data of all types of movies. Then, create a method named lateFeesOwed that iterates through the array and returns the total amount of late fees that are outstanding.

Purchase this Solution

Solution Summary

The attached zip folder contains the whole project with all the required classes and files. The code is written in such a manner that somebody who is still learning will be able to follow it very well and will help in his/her learning. Grab and a copy and check out for yourself, how simple programming can be.

Purchase this Solution


Free BrainMass Quizzes
Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

C++ Operators

This quiz tests a student's knowledge about C++ operators.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.