Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Address MavBox Customer > Bill +calculate Bill)double Rental Movie Game MavBox Customer cus rra -name:String -address:Address -creditCardNumber:String -rentalList:ArrayList +addRental(Rental rental Void +toStringl:Strin meList ArrayList tCustomerList)ArrayList

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

Address MavBox Customer > Bill +calculate Bill)double Rental Movie Game MavBox Customer cus rra -name:String -address:Address -creditCardNumber:String -rentalList:ArrayList +addRental(Rental rental Void +toStringl:Strin meList ArrayList tCustomerList)ArrayList r(Customer customer) Void ie(Movie movie): Void me(Game game) Void xists():Boolean Rental(String name, String typ, String code)Void throws eption ing():String >Rental) Rental(String title, String rentalCode, double price) +getTitle():String +setTitle(String title):Void +getRentalCode():String +setRentalCode(String rentalCode):Void +getPrice)0:double +setPrice(double price):void +calculateChorge():double +toString():String Bill -calculateBill():double **complete to standards ame +MovieType: enum(BLURAY DVD) -mType:MovieTvpe >Movie >Movie(String title, int rentalCode, double price, MovieType type) +setMovieType(MovieType type):Void getMovieType():MovieType +toString():String +GameType:enum(XBOX, PLAYSTATION, NINTENDO -gType:GameType constructors>Game >Game(String title, int rentalCode, double price, GameType type) +setGameType(GameType type):Void +getGameType():GameType +toString():String Write a program, WriteData, that will have three methods, writeCustomers, writeRentals, writeCustomerRentals. These will write data to the customers.txt, rentals.txt, and customerrentals.txt respectively. The following data will be written. Customer Dat Jones,123 One Rd,Arlington,Texas,76019,1234-1234-1234-1234 Smith,54 Lane,Dallas,Texas,76003,6543-6543-6543-65453 Willis,793 First Rd,Fort Worth,Texas,76025,6543-1234-8978 Rental Data Movie,Titanic,1A,4.99,BLURAY Movie,Star Wars,2C,5.99,DVD Game,Warcraft,5D,3.99,PLAYSTATION Game,Tomb Raider,12F,3.59,NINTENDO Movie,Raiders of the Lost Ark, 12T,1.79,BLURAY Movie,Split,8R,2.59,BLURAY Game,Call of Duty,2G,5.99,XBOX Movie,Sixth Sense,4D,3.25,DVD Game,Lego Jurassic World,90,2.25,PLAYSTATION Movie,Avengers,9Y,1.59,DVD Game,Fallout,7W,1.49,NINTENDO Movie,Titanic,1AD,4.99,DVD Movie,Sixth Sense,4DB,3.25,BLURAY Customer Rentals data Jones,Movie,1A Smith,Movie,8R Willis,Game,12F Jones,Movie,2C Smith,Movie,1AD Willis,Game,7W Willis,Movie,4D Baker, Movie,9Y MavBoxTest mv:MavBox +main(String args[):Void +readCustomers():Void +readRentals():Voic +readCustomerRentals):Void +calculateTotal():String calculate Total walks through each customer's rental list, calculates the charge:s, and returns a String with the customer's name and their total charges. Zip up the nine files as HW2.zip and upload to BB. Output should be as follows: Select Command Prompt-Java MavBoxTest :\Users \HotMama\Desktop j2hw2>java MavBoxTest ustomer Does Not Exist Jones $11.98 Smith $8.58 Willis $8.33 Notice that there was one purchaser in the list that did not exist. Address MavBox Customer > Bill +calculate Bill)double Rental Movie Game MavBox Customer cus rra -name:String -address:Address -creditCardNumber:String -rentalList:ArrayList +addRental(Rental rental Void +toStringl:Strin meList ArrayList tCustomerList)ArrayList r(Customer customer) Void ie(Movie movie): Void me(Game game) Void xists():Boolean Rental(String name, String typ, String code)Void throws eption ing():String >Rental) Rental(String title, String rentalCode, double price) +getTitle():String +setTitle(String title):Void +getRentalCode():String +setRentalCode(String rentalCode):Void +getPrice)0:double +setPrice(double price):void +calculateChorge():double +toString():String Bill -calculateBill():double **complete to standards ame +MovieType: enum(BLURAY DVD) -mType:MovieTvpe >Movie >Movie(String title, int rentalCode, double price, MovieType type) +setMovieType(MovieType type):Void getMovieType():MovieType +toString():String +GameType:enum(XBOX, PLAYSTATION, NINTENDO -gType:GameType constructors>Game >Game(String title, int rentalCode, double price, GameType type) +setGameType(GameType type):Void +getGameType():GameType +toString():String Write a program, WriteData, that will have three methods, writeCustomers, writeRentals, writeCustomerRentals. These will write data to the customers.txt, rentals.txt, and customerrentals.txt respectively. The following data will be written. Customer Dat Jones,123 One Rd,Arlington,Texas,76019,1234-1234-1234-1234 Smith,54 Lane,Dallas,Texas,76003,6543-6543-6543-65453 Willis,793 First Rd,Fort Worth,Texas,76025,6543-1234-8978 Rental Data Movie,Titanic,1A,4.99,BLURAY Movie,Star Wars,2C,5.99,DVD Game,Warcraft,5D,3.99,PLAYSTATION Game,Tomb Raider,12F,3.59,NINTENDO Movie,Raiders of the Lost Ark, 12T,1.79,BLURAY Movie,Split,8R,2.59,BLURAY Game,Call of Duty,2G,5.99,XBOX Movie,Sixth Sense,4D,3.25,DVD Game,Lego Jurassic World,90,2.25,PLAYSTATION Movie,Avengers,9Y,1.59,DVD Game,Fallout,7W,1.49,NINTENDO Movie,Titanic,1AD,4.99,DVD Movie,Sixth Sense,4DB,3.25,BLURAY Customer Rentals data Jones,Movie,1A Smith,Movie,8R Willis,Game,12F Jones,Movie,2C Smith,Movie,1AD Willis,Game,7W Willis,Movie,4D Baker, Movie,9Y MavBoxTest mv:MavBox +main(String args[):Void +readCustomers():Void +readRentals():Voic +readCustomerRentals):Void +calculateTotal():String calculate Total walks through each customer's rental list, calculates the charge:s, and returns a String with the customer's name and their total charges. Zip up the nine files as HW2.zip and upload to BB. Output should be as follows: Select Command Prompt-Java MavBoxTest :\Users \HotMama\Desktop j2hw2>java MavBoxTest ustomer Does Not Exist Jones $11.98 Smith $8.58 Willis $8.33 Notice that there was one purchaser in the list that did not exist

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

Pro SQL Server Wait Statistics

Authors: Enrico Van De Laar

1st Edition

1484211391, 9781484211397

More Books

Students also viewed these Databases questions

Question

Give an example of a faulty dismissal.

Answered: 1 week ago

Question

=+a. What is the estimated regression equation?

Answered: 1 week ago

Question

c. Are there any prerequisites for the course?

Answered: 1 week ago