Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Computer Performance Engineering 10th European Workshop Epew 2013 Venice Italy September 17 2013 Proceedings

Authors: Maria Simonetta Balsamo ,William Knottenbelt ,Andrea Marin

2013 Edition

3642407242, 978-3642407246

More Books

Students also viewed these Programming questions