Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program that uses two parallel 5 element arrays: an array of strings that holds the five salsa names, and an array of
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
Step by Step Solution
There are 3 Steps involved in it
Step: 1
import javautilScanner public class SalsaSalesProgram public static void mainString args String sals...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started