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
-
Wolfgangs Masonry management estimates that it takes the company 27 days on average to pay off its suppliers. It also knows that the company has days sales in inventory of 64 days and days sales...
-
The procedural issue is whether the trial court properly granted a directed verdict on the false imprisonment claim. What issue regarding the substantive false imprisonment is raised by the facts of...
-
Why might the government or a company decide to issue bonds?
-
Revenue and production budgets. (CPA, adapted) The Scarborough Corporation manufactures and sells two products: Thingone and Thingtwo. In July 2009, Scarboroughs budget department gathered the...
-
Consider a portfolioof 200shares ofRCa$30/share and 150 shares of BCE at$55/hareOne yar from nowthepiceshave changed to $34 for RC and $52 for BCEThere are no dividends paid or trades made in the...
-
1. Does the amount of purifier have a significant effect on yield, according to this regression analysis? Based on this alone, would you be likely to recommend including a purifying step in the...
-
A corporate bond has a coupon rate of 9%, a yield to maturity of 11.1%, a face value of $1,000, and a market price of $850. Therefore, the annual interest payment iS ?
-
Three good friends are in the same algebra class. Their scores on a recent test or three consecutive odd integers whose sum is 237. Find each score
-
Whirly Corporation's contribution format income statement for the most recent month is shown below: Sales (7,400 units) Variable expenses Contribution margin Fixed expenses Net operating income Total...
-
If f(x) = log(x), what is (are) the transformation(s) that occurs if g(x) = log(x) + 1?
-
Perform the following operations on the complex numbers. 13. (12i-7)+(11-8i)-(6-i) 14. (9-5i)(3-4i) 4i 15. 91-5
-
plain chocolate is 60% carbohydrates, 35% fat and 5% other components. find the ratio of carbohydrates to fat to other components
-
Consider Bandura's Social Cognitive Learning theory and find an online video that delves into this theory. Share the video link with your classmates, and provide a personal example of how this theory...
-
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.
-
\(45-6 \times 7^{3}\) Perform the indicated calculation.
-
\(72 \div 6+18\) Perform the indicated calculation.
-
\(6^{2} \times 5-13 \times 9^{2}\) Perform the indicated calculation.
Study smarter with the SolutionInn App