Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started