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
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()
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps
- I need help with completing my Java programming project. I will be using the software Eclipse for this project so if you could also guide me through the project like labeling what is supposed to be in whatever "4 java files" or what section is what so I'm not trying to guess around, that would be great. Thank youarrow_forwardJava Programingarrow_forwardIn JavaScript, how are an object and an interface related to each other? a. The object’s interface consists of the code and data needed for that object. b. An object’s interface is analogous to a pocket calculator’s inner workings. c. Built-in JavaScript objects do not require an interface, but custom objects do. d. An interface allows another program to access an object’s properties and methods.arrow_forward
- Refer to the following interface: Provide two examples (screenshots) that in many ways could improve the above or similar interface using the principles of direct manipulation. Explain the relevant improvements as well. (Examples might have different object, labels and organization)arrow_forwardPlease help me with these two java programs. Don’t make it complex.arrow_forwardMatch the following: A class that contains no methods (other than constructors) that change any of the data in its object modifier means that there are no restrictions on where an instance variable or method can be used hiding implementation details is done by marking data and methods as When we call a method in Java using class type parameters Overloading is achieved when two or more methods in the same class have the same…arrow_forward
- Write a program which controls a metro train and that keeps track of stations and who gets on and off. Design and implement a class called train, which has at least the following: At least the following attributes (you can include others): metroID stationNum which keeps track of the station that the train is at. iii. direction which keeps track of the direction the train is travelling in. passTotal which keeps track of the number of passengers currently on the train. A default constructor which sets the metroID to a random number between 1 and 1000, the station number to 0, the direction (int), and the passTotal to 0 (train is empty). A constructor with one parameter; the parameter is the metro id. The constructor assigns the passed integer to the metroID attribute; the rest of the attributes are set as described in the default constructor. Accessor methods for each attributes. Mutator methods for each attributes. nextStation(int lastStation) which determines the next…arrow_forwardWorking With Java Classes Define a Java class as described below. All variables should be declared as private and all methods as public. Save the class definition in a file with an appropriate filename. Class Name: Family Instance Variables: numDependents - int (Fields) annualIncome - double Instance Methods: A constructor that accepts no arguments and sets the number of dependents field to 1 and the annual income field to zero. rate). A constructor that accepts 1 argument, an annual income amount and sets the number of dependents to1. A constructor that accept 2 arguments representing an initial value for each of the fields. Accessor/Getter Methods: (Use appropriate method names) dependents() A function to return the number of dependents. income() A function to return the annual income amount. Mutator/Setter Methods: (Use appropriate method names) dependents() A function that has an integer formal argument that is assigned to the number of dependents field. income() A function that…arrow_forwardIn Java!!!!!This is a multi-part question. Consider the following UML diagram on attached image: 1.Write Java classes corresponding to the UML diagram. 2. Write getters and setters for all classes 3. Write non-default constructors for each class that initializes all instance variables to values passed as arguments to the constructor 4. Write toString method for each class 5. Modify Vehicle class to maintain inventory (list of all vehicles created) and print the list. What variable(s) you need to add? What additional method(s) you need? What else needs to be modified in the Vehicle class? Do you need to modify any of the descendant classes and explain your answer (if not: why not; if yes, describe what changes). Vehicle {Abstract} manufacturer:String - color:String Car Truck TwoWheeler {Abstract} -numberOfDoors:int -numberOfAxels:int -passengerSeats:int -fuelType:String -fuelLevel:int -fuelType:String -numberOfSeats:int -fuelLevel:int Truck Motorcycle -numberOfAxels:int -fuelType:String…arrow_forward
- choose the correct answer in javaarrow_forwardIn JAVA. Help with this would be greatly appreciated! Create the four data classes as above. Do NOT add any attributes or methods that don't appear in the UML diagrams. Create another, executable class named ShipTest as shown below to test these classes. In ShipTest: make two objects with declared type Ship but actual type CruiseShip. make one object of declared type Ship but actual type CargoShip. make one object of declared type CargoShip and actual type CargoShip. make a ship of declared type WarShip and actual type WarShip. using the array initializer syntax, code all of these ships into an array of type Ship named fleet. code a for loop that processes the fleet array to show display all ships and their data. use a method of class Arrays to create an ArrayList of type Ship from the fleet array. pass this ArrayList to a method named shipShow that also displays all ships and returns an integer. report the value of the integer returned by shipShow. In the shipShow method: from…arrow_forwardCreate a class Person to represent a person according to the following requirements: A person has two attributes: id Add a constructer to initialize all the attributes to specific values. Add all setter and getter methods. Create a class Product to represent a product according to the following requirements: A product has four attributes: a reference number (can’t be changed) a price an owner (is a person) a shopName (is the same for all the products). Add a constructer without parameters to initialize all the attributes to default values (0 for numbers, "" for a string and null for object). Add a second constructer to initialize all the attributes to specific values. Use the keyword "this". Add the method changePrice that change the price of a product. The method must display an error message if the given price is negative. Add a static method changeShopName to change the shop name. Add all the getter methods. The method getOwner must return an owner. Create the class…arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education