A supermarket wants to reward its best customer of each day, showing the customers name on a

Question:

A supermarket wants to reward its best customer of each day, showing the customer’s name on a screen in the supermarket. For that purpose, the customer’s purchase amount is stored in an ArrayList and the customer’s name is stored in a corresponding

ArrayList.

Implement a method

public static String nameOfBestCustomer(ArrayList sales,

ArrayList customers)

that returns the name of the customer with the largest sale. Write a program that prompts the cashier to enter all prices and names, adds them to two array lists, calls the method that you implemented, and displays the result. Use a price of 0 as a sentinel.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Java Concepts Late Objects

ISBN: 9781119186717

3rd Edition

Authors: Cay S. Horstmann

Question Posted: