Do not accept negative values for this number.

Burdened by Homework? Let us write your essays and assignments Order This Now

Arrays
Your goal is to record the sales for different types of soda and determine the total sales and the names of the highest and lowest selling soda.
Ask the user how many soda types of soda they want to sell. Do NOT accept negative values for this number. (2 points)
Use the number that the user entered to execute a loop to enter the names of the sodas into a name array. (3 points)
Loop through the soda name array asking the user for the number of bottles sold for each type of soda. Do not accept negative values for the number of bottles sold. Store these numbers into an integer array. (4 points)
Display the total sales and the names of the highest selling and lowest selling sodas. (6 points)
Example Output:
How many types of soda would you like to enter: -1
How many types of soda would you like to enter: 3
Enter the name of soda type 1: Sprite
Enter the name of soda type 1: Pepsi
Enter the name of soda type 1: Mountain Dew
Enter the number of Sprite bottles sold: -5
Enter the number of Sprite bottles sold: 125
Enter the number of Pepsi bottles sold: 107
Enter the number of Mountain Dew bottles sold: 203
——————————————
Total Sold: 435
Highest Sold: Mountain Dew
Lowest Sold: Pepsi

Burdened by Homework? Let us write your essays and assignments Order This Now

Published
Categorized as Java

Leave a comment