Question
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++ =
- 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.
- 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.
- 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:
- 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!
- Converting Temperatures
Use the steps and sample output below to figure out what should happen in this part of the program.
- Use a do-while loop to run the content in this section until the user selects to go back to the MAIN MENU.
- Display the OVEN TEMBERATURES menu, which includes information about boiling and freezing water.
- Read in the users choice & validate the users choice with a WHILE LOOP
- Use either a switch statement or if-else if statement to do the proper conversions.
- Your calculations must be correct and output should be limited to 2 places after the decimal point.
- Each time you do a conversion you should increment the number of conversions performed in the program.
- 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.
-
Use a do-while loop to run the content in this section until the user selects to go back to the MAIN MENU.
-
Display the OVEN TEMBERATURES menu, which includes information about boiling and freezing water.
-
Read in the users choice & validate the users choice with a WHILE LOOP
-
Use either a switch statement or if-else if statement to do the proper conversions.
-
Your calculations must be correct and output should be limited to 2 places after the decimal point.
-
Each time you do a conversion you should increment the number of conversions performed in the program.
-
Refer to sample output below to see this section of the code executing. All values highlighted in yellow is input from the user.\
-
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
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