Answered step by step
Verified Expert Solution
Question
1 Approved Answer
java code Your goal is to record the sales for different types of soda and determine the total sales and the names of the highest
java code
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
Step by Step Solution
There are 3 Steps involved in it
Step: 1
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