Write a program that uses two parallel 5 element arrays: an array of strings that holds...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program that uses two parallel 5 element arrays: an array of strings that holds the five salsa names, and an array of integers that holds the number of jars sold during the past month for each salsa type. The salsa names should be stored using an initialization list at the time the name array is created. The program should prompt the user to enter the number of jars sold for each type. Validate the input by not accepting negative values for number of jars sold. Once this sales data has been entered, the program should produce a report that displays the number of jars sold for each salsa type, the total number of jars sold for all salsa types, and the names of the highest selling and lowest selling products. You are required to create 3 functions. One function should calculate the total number of jars sold for all types. The second function should find the position and the name of the highest selling salsa. The third function should find the position and the name of the lowest selling salsa. Note: Here is sample input and the report. C:\Qt\Tools\QtCreator\bin\qtcreator_process_stub.exe Jars sold last month of mild : 556 Jars sold last month of medium: 734 Jars sold last month of sweet : 230 Jars sold last month of hot : 652 Jars sold last month of zesty : 894 Name Salsa Sales Report mild medium Sweet hot zesty Jars Sold Total Sales: High Seller: zesty Low Seller: sweet 556 734 230 652 894 3066 Write a program that uses two parallel 5 element arrays: an array of strings that holds the five salsa names, and an array of integers that holds the number of jars sold during the past month for each salsa type. The salsa names should be stored using an initialization list at the time the name array is created. The program should prompt the user to enter the number of jars sold for each type. Validate the input by not accepting negative values for number of jars sold. Once this sales data has been entered, the program should produce a report that displays the number of jars sold for each salsa type, the total number of jars sold for all salsa types, and the names of the highest selling and lowest selling products. You are required to create 3 functions. One function should calculate the total number of jars sold for all types. The second function should find the position and the name of the highest selling salsa. The third function should find the position and the name of the lowest selling salsa. Note: Here is sample input and the report. C:\Qt\Tools\QtCreator\bin\qtcreator_process_stub.exe Jars sold last month of mild : 556 Jars sold last month of medium: 734 Jars sold last month of sweet : 230 Jars sold last month of hot : 652 Jars sold last month of zesty : 894 Name Salsa Sales Report mild medium Sweet hot zesty Jars Sold Total Sales: High Seller: zesty Low Seller: sweet 556 734 230 652 894 3066
Expert Answer:
Answer rating: 100% (QA)
import javautilScanner public class SalsaSalesProgram public static void mainString args String sals... View the full answer
Related Book For
Posted Date:
Students also viewed these computer network questions
-
How do cells sense and respond to environmental cues, such as changes in nutrient availability, mechanical forces, and extracellular matrix composition, through intricate signaling networks involving...
-
In this project, we will write a program that controls a quiz show, much like the many popular TV shows. The program will read in a group of questions and their multiple choice answers, storing them...
-
A particular talents competition has 5 judges, each of whom award a score between 0 and 10 to each performer. Fractional scores, such as 8.3 are allowed. A performers final score is determined by...
-
Casrnir proposes a model of third-culture building to account for the evolutionary nature of intercultural dialogue. What role do you think the many studies on cultural dimensions can play in the...
-
Assume that Penske Tire, a large tire distributor, completed the following selected transactions: 2013 Dec. 1 Sold tires to Select Movers Inc., receiving a $40,000, six-month, 5 percent note. Ignore...
-
Each test of an integrated circuit probability p, independent of the outcome of the test of any other circuit. In testing n circuit. In testing n circuits, let K denote the number of circuits...
-
How to use the Internet to gather facts?
-
Assume that on January 31,2014, Microsoft Corporation acquired 90 percent of the outstanding common stock of Power-line Technologies for $3,000,000 cash plus 200,000 shares of Microsoft's $10 par...
-
You have a credit card with a current balance of $150. The interest rate is 13.99% and you use this card to pay your cell phone bill of $89 each month. That is now the only time you use this card....
-
what does it mean when they say "Family law agreements are binding if there is a lack of consideration, formality of signatures or witnesses, or non-involvement of a family law dispute resolution...
-
Check out the two current articles below on Supply Chain Management. Were you familiar with the term 'supply chain management' before and the challenges businesses are having with regards to it? What...
-
Demonstrate critical thinking and critical analysis skills, including use of a research based argumentation must be between 1,2OO - 1,5OO words Papers that do not meet at least 1,2OO words are...
-
Design three activity plan worksheets, one for infant/toddler, one for preschool and one for primary age children up to 3rd grade. Each activity worksheet will have: developmentally appropriate child...
-
Hair World Incorporated is a wholesaler of hair supplies. Hair World uses a perpetual inventory system. The following transactions (summarized) have been selected for analysis: a. Sold merchandise...
-
The present share capital of A Ltd. consists of 1000 shares selling at Rs.100 each. The company is contemplating a dividend of Rs.10 per share at the end of the current financial year. The company...
-
You are buying a new house. Current mortgage rates are 6.5% APR. Lenders are offering 30 year mortgages with monthly payments. They require 20% down payments and will finance the remaining 80% with...
-
What examples of economies of scale can Eastern Gear introduce? What strategies can Eastern Gear implement to help their production and inventory control? How can Eastern Gear better absorb new...
-
Suppose a population of bacteria doubles every hour, but that 1.0 x 106 individuals are removed before reproduction to be converted into valuable biological by-products. Suppose the population begins...
-
Why was GUI programming complex and time consuming in the early days of GUI technology?
-
True or False In our pseudocode, the Init module automatically executes when the application starts.
-
What access specifier is commonly used with a classs fields?
-
A spring-mass system has a natural period of \(0.21 \mathrm{~s}\). What will be the new period if the spring constant is (a) increased by \(50 \%\) and (b) decreased by \(50 \%\) ?
-
An industrial press is mounted on a rubber pad to isolate it from its foundation. If the rubber pad is compressed \(5 \mathrm{~mm}\) by the self weight of the press, find the natural frequency of the...
-
Three springs and a mass are attached to a rigid, weightless bar \(P Q\) as shown in Fig. 2.51. Find the natural frequency of vibration of the system. 0000 0000 k 12. 13 m + FIGURE 2.51 Rigid bar...
Study smarter with the SolutionInn App