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)
It seems you need help with a Java programming assignment that involves writing a program to determine the best customer based on daily sales in a sup... 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
-
1. Give five examples of income that must be included in income reported to the internal revenue service. 2. How are long-term and short-term capital gains treated differently for income tax...
-
A particle with charge 2.15µC and mass 3.20 X 10-11 kg is initially travelling in the +y-direc1ion with a speed U0 = 1.45 X 105 m/s. It then enters a region containing a uniform magnetic field...
-
Stone Brewing Co. is a San Diego brewer that has sold its beers for over two decades. Stone has maintained its trademark and brand from the beginning, registering the STONE mark in 1998. Stone has...
-
Capital Co. has a capital structure, based on current market values, that consists of 50 percent debt, 10 percent preferred stock, and 40 percent common stock. If the returns required by investors...
-
A beam of light travels from a vacuum into water at an angle of 45. The light has a frequency of 6.00 x 1014 Hz and travels at a speed of 2.26 x 108 m/s in water. The speed of light in a vacuum is...
-
The MFG Corporation is planning to produce and market three different products. Let x1, x2, and x3 denote the number of units of the three respective products to be produced. The preliminary...
-
The first step to take in choosing to import products is to: Contact possible suppliers in other nations. B Receive the imported products. Arrange for shipment of the products. D Determine demand for...
-
Find the product. (3x+5y)
-
Are cryptocurrencies a foreign currency, financial instrument, or some other type of asset? How are cryptocurrencies accounted for under US GAAP? The FASB has proposed new guidance for accounting for...
-
What employee benefit plan records need to be retained permanently? Explain Why.
-
Merrill Lynch allows clients to view statements, make payments, and conduct stock trades, all online. Additionally, clients can read about market trends and other activities in the stock market....
-
Time Value of Money 1. A company needs to have $2,500,000 6 years from now for a building project. In an investment opportunity that pays 9%, how much will have to be deposited today in order to...
-
(i) Explain whether or not the discount rate used by the firm in its NPV calculations is needed when employing the Internal Rate of Return (IRR) method of project appraisal. (ii) If the NPV of a...
-
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.
-
Cruz Manufacturing Ltds sales slumped badly in 2019. For the first time in its history, it operated at a loss. The companys income statement showed the following results from selling 600 000 units of...
-
The following are emails from various students to Dr. Destiny Sands, who is a professor in the English Department. These students are wondering if Dr. Sands would let them register for her...
-
What are some flawed assumptions about workplace communication? What is the reality for each myth?
Study smarter with the SolutionInn App