solve this question using java 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 database for your system needs to be represented using two ArrayList objects. One ArrayList will represent 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()

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

solve this question using java

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 database for your system needs to be represented using two ArrayList objects. One ArrayList will represent
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()

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
Transcribed Image Text: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
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.
Transcribed Image Text: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.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Development strategies
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education