Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Comments needed for more understanding of Restaurant Class . Thank you 1) Exercise 1 . (Step-1) Create a class called Customer. Add a constructor of

Comments needed for more understanding of Restaurant Class . Thank you

image text in transcribed

1) Exercise 1 . (Step-1) Create a class called Customer. Add a constructor of the class Customer that takes the name and purchase amount of the customer as inputs .Write getter methods getName and getPrice to return the name and price of the cus- tomer. You can write a toString0 method which returns printed string of Customeir name and its purchase. . (Step-2) Create a class called Restaurant. . Write a method addsale that takes customer name and purchase amount of the customer in the class restaurant ans stores it into an array list. . Write a method nameBestCustomer that returns customer name who bought highest sale in the restaurant. (Step-3) Write a tester class that prompts the user to enter name and purchase of the customers and display the name of the customer who bought highest sales in the restaurant. Import java.util.Scanner

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

More Books

Students also viewed these Databases questions

Question

600 lb 20 0.5 ft 30 30 5 ft

Answered: 1 week ago