Question: 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

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
Get step-by-step solutions from verified subject matter experts
