Help on this. thanks 2022SP CS234 Computer Science II 1. (Based on P6.11) A supermarket wants to
Fantastic news! We've Found the answer you've been seeking!
Question:
Help on this. thanks
Transcribed Image Text:
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<Double> sales, ArrayList<String> 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<Double> sales, ArrayList<String> 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. 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<Double> sales, ArrayList<String> 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<Double> sales, ArrayList<String> 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.
Expert Answer:
Answer rating: 100% (QA)
Heres a Java program that fulfills the requirements for Lab 5 import javautilArrayList import javaut... View the full answer
Related Book For
Posted Date:
Students also viewed these electrical engineering questions
-
Economics Hi please help me this statement thanks Hi please help me to answer this statement on below question, you dont have to show your work (in this case the decision tre
-
Thanks to a recent pay raise, you now have enough funds to pay for a housecleaner every other week. You are therefore in a position to delegate this dreadful cleaning task to someone else. What steps...
-
Could someone help with this please! Thanks (a) Design a synthesis of the following compound from uncharged, metal-free compounds containing up to five contiguous C atoms and no elements other than C...
-
Describe, draw, the curve with the following parametric equations in the cylindrical co-ordinate space: r = 5, z = 2,0 = t
-
What are the five fundamental principles of accounting information systems?
-
Let X be a positive random variable. Show that for all c, P(logX c) e c .
-
How to draft a settlement agreement?
-
A process that produces titanium forgings for automobile turbocharger wheels is to be controlled through the use of a fraction nonconforming chart. Initially, one sample of size 150 is taken each day...
-
Use a DATA step to create a permanent working SAS data set of "nhanes1718_sub" called "nhanes". Within this DATA step, use a series of IF-THEN-ELSE-IF statements (IF-THEN logic) to create the...
-
What is the value of CP's revised offer on December 8 (before CP "sweetened" its offer by adding the CVR security)? In your analysis, assume the following: a) A valuation date of December 31, 2015,...
-
Lawson Corporation has the following data for the use of its machinery Mes Use Cost Jun 600 $750 Jul 650 775 Ago 420 550 September 500 650 Oct 450 570 See Lawson Corporation data. What will be the...
-
4. A ball bounces at 70% of its last height after each bounce. If the ball falls from a height of 2 metres to begin with, how high will the ball get to at the fourth bounce?
-
Solve 2 x + 5 0 0 = 6 0 0
-
Wellington Seafood Company would like to sell 4,000 shares of stock to acquire its competitor Kapiti Crab Inc. The manager decides to use Dutch auction underwriting. The bids received are: Quantity...
-
If a hansom cab ride costs $ 2 2 0 if you drive for 5 miles around NYC , and $ 1 6 9 if you drive 2 miles. Find the equation that defines this relationship. A car dealer offers a new car at a price...
-
The FASB's revised standard on leases, ASC 842, was effective for public companies beginning 2018. One significant implication of this standard is that operating leases that were previously kept off...
-
Help why are all these test failings? Then help explain why! This is the test file that keeps failing! package hw4; import static org.junit.Assert.*; import java.util.NoSuchElementException; import...
-
Diamond Walker sells homemade knit scarves for $25 each at local craft shows. Her contribution margin ratio is 60%. Currently, the craft show entrance fees cost Diamond $1,500 per year. The craft...
-
What is the difference between a set and a map?
-
Roman numbers. Write a program that converts a positive integer into the Roman number system. The Roman number system has digits I ........1 V ........5 X ........10 L ........50 C ........100 D...
-
What happens if you place multiple buttons directly into the SOUTH area, without using a panel? Try it out by writing a small sample program if you arent sure of the answer.
-
Using the fourth-order Runge-Kutta method, solve Problem 11.15. Data From Problem 11.15:- Using the second-order Runge-Kutta method, solve the differential equation \(\ddot{x}+1000 x=0\) with the...
-
Using the central difference method, find the response of the two-degree-of-freedom system shown in Fig. 11.2 when \(c=2, F_{1}(t)=0, F_{2}(t)=10\). Figure 11.2:- X1(t) -x2(t) F(1) k=2 -F2(t) k = 4...
-
Using the central difference method, find the response of the system shown in Fig. 11.2 when \(F_{1}(t)=10 \sin 5 t\) and \(F_{2}(t)=0\). Figure 11.2:- X1(t) -x2(t) F(1) k=2 -F2(t) k = 4 k2=6 00000...
Study smarter with the SolutionInn App