Answered step by step
Verified Expert Solution
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
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...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