solve this question using only java object oriented programming, also you will need do use a 4 files in driver class ,d1 will help you to understand the realation between the classes, and d3 to know the function in index A you must define a class named MediaRental that implements the MediaRentalInt interface functionality (index A). You must define classes that support the functionality specified by the interface: . Define a class named MediaRental. Feel free to add any instance variables you understand are needed or any private methods. Do not add any public methods (beyond the ones specified in the MediaRentalInt interface). . The media rental system keeps track of customers and media (movies ,music albums and games). A customer has a name, address as string , a plan and two lists. One list represent the media the customer is interested in receiving and the second one represents the media already received (rented) by the customer. There are two plans a customer can have: UNLIMITED and LIMITED. UNLIMITED allows a customer to receive as many media as they want; LIMITED restricts the media to a default value of 2 (this value can be change via a media rental class method).
solve this question using only java object oriented programming, also you will need do use a 4 files in driver class ,d1 will help you to understand the realation between the classes, and d3 to know the function in index A
you must define a class named MediaRental that implements the MediaRentalInt interface functionality
(index A). You must define classes that support the functionality specified by the interface:
. Define a class named MediaRental. Feel free to add any instance variables you understand are needed or any private methods. Do not add any public methods (beyond the ones specified in the MediaRentalInt interface).
. The media rental system keeps track of customers and media (movies ,music albums and games). A customer
has a name, address as string , a plan and two lists. One list represent the media the customer is interested in
receiving and the second one represents the media already received (rented) by the customer. There are two
plans a customer can have: UNLIMITED and LIMITED. UNLIMITED allows a customer to receive as many media
as they want; LIMITED restricts the media to a default value of 2 (this value can be change via a media rental
class method).
A movie has a title, a number of copies available and a rating (e.g., "HR"). An album has a title, number of
copies available, an artist and the songs that are part of the album. A game has title,number of copies,and the
weight (in grams) is also stored.
. You must define and use at least four classes (not including MediaRental) as part of your design. At least two of
those classes must be in a superclass/subclass relationship (Inheritance Requirement). The other two can be
defined as you wish. Feel free to define as many classes as you want. These classes must support the
functionality of the system otherwise you will not receive any credit.
. One of your classes must define an equals method that has as parameter an Object parameter.
. The
the customers present in the database; the second will represent the media (movies, albums , and games).
. Regarding the searchMedia method: the songs parameter represents a substring (fragment) or the full list of
songs associated with the album. If the full list is provided you can assume commas will be part of the string.
Hint: you may want to consider using the indexOf method of the String class.
7. Your program should store the results in a file between executions of the program, so
that when the program is run again it will start up with the same inventory contents as
when it last terminated.
. free to use Collections.sort to sort your data.
. Write test driver.
. Handle expectations where it’s needed.
.Not all the details associated with the project can be fully specified in this description. The sooner you start
working on the project the sooner you will be able to address any doubts you may have.
Index A
in the second picture.(d3)
index B:
Index B:
Public Driver:
Method Detail
public void testAddingCustomers()
public void testAddingMedia()
public void testingAddingToCart()
public void testingRemovingFromCart()
public void testProcessingRequestsOne()
public void testProcessingRequestsTwo()
public void testReturnMedia()
public void testSearchMedia()
![void setLimitedPlanLimit (int value)
This set the number of media associated with the LIMITED plan.
Parameters: value -
getAl1CustomersInfo
String getAliCustomersInfo ()
Returns information about the customers in the database. The information is presented sorted by cus-
tomer name.
Returns:
getAl1MediaInfo
String getAl1MediaInfo ()
Returns information about all the media (movies, albums, and games) that are part of the database. The
information
Index A:
is presented sorted by media title.
Returns:
MediaRentallnt interface Includes:
addToCart
Method Detail
boolean addToCart (String customerName, String mediaTitle)
addCustomer
Adds the specified media title to the cart associated with a customer.
void addCustomer (String name, String address, String plan)
Adds the specified customer to the database. The address is a physical address (not e-mail). The plan
Parameters:customerName - , mediaTitle -
Returns: false if the mediaTitle is already part of the cart (it will not be added)
options available
removeFromCart
are: LIMITED and UNLIMITED. LIMITED defines a default maximum of two media that can be rented.
boolean removeFromCart (String customerName, String mediaTitle)
Parameters: name - , address -, plan -
Removes the specified media title from the customer's cart.
Parameters:customerName - , mediaTitle -
Returns: false if removal failed for any reason (e. g., customerName not found)
addMovie
void addMovie (String title, int copiesAvailable, String rating)
Adds the specified movie to the database. The possible values for rating are "DR", "HR", "AC".
processRequests
Parameters:title - , copiesAvailable -, rating -
String processRequests ()
addGame
Processes the requests cart of each customer. The customers will be processed in alphabetical order.
void addGame (String title, int copiesAvailable, double weight)
For each customer,
Adds the specified game to the database.
the requests cart will be checked and media will be added to the rented cart, if the plan associated
Parameters:title - , copiesAvailable -, weight -
with the customer
addAlbum
allows it, and if there is a copy of the media available. For UNLIMITED plans the media will be added
void addAlbum (String title, int copiesAvailable, String artist, String songs)
to the rented
Adds the specified album to the database. The songs String includes a list of the title of songs in the
cart always, as long as there are copies associated with the media available. For LIMITED plans, the
album (song
titles are separated by commas).
number of entries
moved from the requests cart to the rented cart will depend on the number of currently rented media,
Parameters: title - , copiesAvailable -, artist -, songs -
and whether copies
setLimitedPlanLimit
associated with the media are available.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Ffc03ea1b-3a89-4a24-aa91-9907626e940e%2Fb596441b-6155-454b-b6ac-8447538d1273%2Fqtywawl_processed.png&w=3840&q=75)
![This project goal is to develop a rental media system This underneath UML diagram may help you to understand the
system requirements
EMediaRentalManger
«MediaRentallnt»
Media
«Comparable»
Customer
Game
Movie
Album](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Ffc03ea1b-3a89-4a24-aa91-9907626e940e%2Fb596441b-6155-454b-b6ac-8447538d1273%2Fr778ge5_processed.jpeg&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 3 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)