Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

C++ =

  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.

4.3Converting 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.\

  8. 4.4Viewing Solid Measurements

    You will display a menu of options to the user, read in the users choice. Validate the users choice. Use a switch statement to display what the user wants to see. Refer to the sample output below to see the menu options and what should be printed out for each option. All user input is highlighted in yellow. Note: Use setw() to make your columns of data!

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

Database And Expert Systems Applications Dexa 2022 Workshops 33rd International Conference Dexa 2022 Vienna Austria August 22 24 2022 In Computer And Information Science 33

Authors: Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil ,Bernhard Moser ,Alfred Taudes ,Atif Mashkoor ,Johannes Sametinger ,Jorge Martinez-Gil ,Florian Sobieczky ,Lukas Fischer ,Rudolf Ramler ,Maqbool Khan ,Gerald Czech

1st Edition

3031143426, 978-3031143427

More Books

Students also viewed these Databases questions

Question

2. To store it and

Answered: 1 week ago

Question

What is topology? Explain with examples

Answered: 1 week ago