Question: Specifications for your main function Note: You will not have any other functions other than your main function in this program. Do NOT create any

  1. Specifications for your main function

Note: You will not have any other functions other than your main function in this program. Do NOT create any programmer-defined functions. You will get to practice creating your own functions in future programming and lab assignments.

  1. The DO-WHILE LOOP

In order for your program to run multiple times until the user selects to end the program, you will need a do-while loop in the main function. The do part of the loop should be located before the main menu and should end after the switch statement.

  1. The MAIN MENU

Your MAIN MENU should look like mine (below). Display the menu. Then, as the user to choose 1-4. Then, read in their choice. Then, validate their choice with a WHILE LOOP. If they entered something other than a 1-4 then your while loop should force the user to enter in a valid choice.

--MAIN MENU--

What would you like to look at?

1. Oven Temperatures & Conversions

2. View Solids Measurements

3. Liquids Measurements & Conversions

4. End the Program

CHOOSE 1-4:

  1. The SWITCH STATEMENT

Based on what the user selected, use a switch statement to execute the appropriate code based on their choice. If the user selected #1, then your program will execute the statements described in section 4.3 Converting Temperatures of this document. If the user selects #2, then the program will execute the statements described in section 4.4 Viewing Solid Measurements of this document. If the user selects #3 then the program will execute the statements described in section 4.5 Converting Liquids of this document. If the user chose #4 then the switch statement will end and the do-while loop will end. Your program should lastly print out a message before the program ends like the sample output below, indicating how many calculations were performed (adding all calculations performed when the user selected 1 or 3 in the main menu).

--MAIN MENU--

What would you like to look at?

1. Oven Temperatures & Conversions

2. View Solids Measurements

3. Liquids Measurements & Conversions

4. End the Program

CHOOSE 1-4: 4

Thank you for using the measurement program.

Hopefully you can cook something really special for me

because you made 6 conversions!

  1. Converting Temperatures

Use the steps and sample output below to figure out what should happen in this part of the program.

  1. Use a do-while loop to run the content in this section until the user selects to go back to the MAIN MENU.
  2. Display the OVEN TEMBERATURES menu, which includes information about boiling and freezing water.
  3. Read in the users choice & validate the users choice with a WHILE LOOP
  4. Use either a switch statement or if-else if statement to do the proper conversions.
  5. Your calculations must be correct and output should be limited to 2 places after the decimal point.
  6. Each time you do a conversion you should increment the number of conversions performed in the program.
  7. Refer to sample output below to see this section of the code executing. All values highlighted in yellow is input from the user.

--MAIN MENU--

What would you like to look at?

1. Oven Temperatures & Conversions

2. View Solids Measurements

3. Liquids Measurements & Conversions

4. End the Program

CHOOSE 1-4: 3

--LIQUIDS MEASUREMENTS--

What measurement do you know?

1. I know how many gallons I have.

2. I know how many quarts I have.

3. I know how many pints I have.

4. I know how many cups I have.

5. Go back to MAIN MENU.

CHOOSE 1-5: 1

How many gallons do you have?

3.4

RESULT: 3.40 gallons is 13.60 quarts, 27.20 pints, or 54.40 cups.

--LIQUIDS MEASUREMENTS--

What measurement do you know?

1. I know how many gallons I have.

2. I know how many quarts I have.

3. I know how many pints I have.

4. I know how many cups I have.

5. Go back to MAIN MENU.

CHOOSE 1-5: 2

How many quarts do you have?

4.8

RESULT: 4.80 quarts is 1.20 gallons, 9.60 pints, or 19.20 cups.

--LIQUIDS MEASUREMENTS--

What measurement do you know?

1. I know how many gallons I have.

2. I know how many quarts I have.

3. I know how many pints I have.

4. I know how many cups I have.

5. Go back to MAIN MENU.

CHOOSE 1-5: 3

How many pints do you have?

8.3

RESULT: 8.30 pints is 1.04 gallons, 4.15 quarts, or 16.60 cups.

--LIQUIDS MEASUREMENTS--

What measurement do you know?

1. I know how many gallons I have.

2. I know how many quarts I have.

3. I know how many pints I have.

4. I know how many cups I have.

5. Go back to MAIN MENU.

CHOOSE 1-5: 4

How many cups do you have?

14.2

RESULT: 14.20 cups is 0.89 gallons, 3.55 quarts, & 7.10 pints.

--LIQUIDS MEASUREMENTS--

What measurement do you know?

1. I know how many gallons I have.

2. I know how many quarts I have.

3. I know how many pints I have.

4. I know how many cups I have.

5. Go back to MAIN MENU.

CHOOSE 1-5: 5

--MAIN MENU--

What would you like to look at?

1. Oven Temperatures & Conversions

2. View Solids Measurements

3. Liquids Measurements & Conversions

4. End the Program

CHOOSE 1-4: 4

Thank you for using the measurement program.

Hopefully you can cook something really special for me

because you made 6 conversions!

Thats How the end result should be.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!