Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Help on this. thanks 2022SP CS234 Computer Science II 1. (Based on P6.11) A supermarket wants to reward its best customer of each day, showing

image

image

Help on this. thanks

2022SP CS234 Computer Science II 1. (Based on P6.11) 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, and the customer's name is also stored. /** Lab 5 Total points: 100 You need to write a Java program. Your program must implement the following methods and only these methods (besides the main method) : /** Get the input for the prices and names and add them to the Array Lists @param an ArrayList for the sales @param an ArrayList for the names */ public static void getValues (ArrayList sales, ArrayList customers) Finds the best customer based on the sales. @param an ArrayList for the sales @param an ArrayList for the customers @return a String with the name of the customer */ public static String nameOfBestCustomer (ArrayList sales, ArrayList customers) The getValues () method is used to ask the cashier to enter all prices and names and to add them to two array lists. Use a negative or zero price as sentinel to stop asking values. If the price is not a negative or zero price the program must continue asking for values. The nameOfBest Customer () method is used to get the name of the best customer. When getting the best customer, if the there are no elements in the lists, then your program needs to send a message to the user.

Step by Step Solution

3.28 Rating (145 Votes )

There are 3 Steps involved in it

Step: 1

Heres a Java program that fulfills the requirements for Lab 5 import javautilArrayList import javaut... 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

Java Concepts Late Objects

Authors: Cay S. Horstmann

3rd Edition

1119186714, 978-1119186717

More Books

Students also viewed these Electrical Engineering questions

Question

What is the difference between a set and a map?

Answered: 1 week ago

Question

Determine a value index for 2013 using 1990 as the baseperiod.

Answered: 1 week ago