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
-
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...
-
When a flashlight is operated, what is being used up; battery current, battery voltage, battery energy, battery power, or battery resistance? Explain.
-
Can people tell the difference between a female nose and a male nose? This important (?) research question was examined in the article You Can Tell by the Nose: Judging Sex from an Isolated Facial...
-
Douglas Singletary purchased a mobile home from P&A Investments, Inc. d/b/a Andys Mobile Home and Land Sales. On November 17, 2007, Singletary entered in a sales agreement with Andys to purchase a...
-
The emergency services coordinator for Clarke County is interested in locating the countys two ambulances to maximize the number of residents that can be reached within four minutes in emergency...
-
4. The effects of the German reunification in the Solow world. Imagine that West Germany in 1989 was well represented by the following differential equation. k =ska (8+n+g)k Let's assume that at that...
-
Aero Motorcycles is considering opening a new manufacturing facility in Fort Worth to meet the demand for a new line of solar-charged motorcycles (who wants to ride on a cloudy day anyway?) The...
-
(a) Expand function ex into Tailor series about point x=0. (b) Consider these series truncated after the first two terms. Estimate the absolute error of this truncation as a function of x. (c)...
-
You expect to receive $31,000 at graduation in two years. You plan on Investing it at 9.25 percent until you have $166,000. How long will you wait from now? (Do not round Intermediate calculations...
-
How can I write this email in a professional manner by using headings/bullets? From: Susan Janzen To: All Staff Cc: IT Support Subject: Complaints A bunch of you have complained to me about the new...
-
A car leasing company leases cars to customers for a three-year period. Each year 10% of the vehicles get into accidents. Different accident years are independent. At the end of the lease, 25% of the...
-
Rio Inc. company is analyzing a project requiring an initial investment of $20 million. At the end of 7 years the machinery has no further value. The machinery falls into asset Class 38, which has a...
-
Moerdyk Corporation's bonds have a 15-year maturity, a 5.25% coupon rate with interest paid semiannually, and a par value of $1,000. The nominal required rate of return on these bonds is 7.75%. What...
-
I need a swot Analysis for St. Joseph's University Medical Center 5 points each plz
-
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?
-
Figure P2.4 shows a graph of position versus frame number from a video clip of a moving object. Describe this motion from beginning to end, and state any assumptions you make. Data from Figure P2.4...
-
What minimum information must be extracted from a video clip of a moving object in order to quantify the object's motion?
-
The sequence in Figure P2.3 represents a ball that is initially held above the ground. In the first frame the ball is released. In subsequent frames the ball falls, bounces on the ground, rises, and...
Study smarter with the SolutionInn App