Answered step by step
Verified Expert Solution
Link Copied!

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

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

DATABASE Administrator Make A Difference

Authors: Mohciine Elmourabit

1st Edition

B0CGM7XG75, 978-1722657802

More Books

Students also viewed these Databases questions