Question: Write a C + + program that shows the following menu: P [ rogram Overview ] T [ emp Conversion ] Q [ uit ]

Write a C++ program that shows the following menu:
P[rogram Overview] T[emp Conversion] Q[uit]
If you select "t or T" you should invoke a user define function void convert (double, double, char) to convert all the temperatures between TempMIN and TempMAX entered by the user, from Celsius to Fahrenheit, or vice versa. The user needs to input "C" or "c" to convert to Celsius and "F" or "f" to convert to Fahrenheit. The following formulas are employed.
F =(9/5)C +32 C =5/9(F 32)
If you select "P or p" Your program should invoke a user-defined function, void prog_Description (void) that displays the overall operation of your program by stating the objectives and describing the sequence of specific steps the program executes and how the user respond to the program prompt.
You should use looping control structures in your program to compute the voltage values and Switch statements to determine the type of output. You will need to use the for input and output displays, and libraries to format the output statements. You can also use to access OS commands.
If the user selects "q or Q" then your program should terminate.
Algorithm Pseudocode
Algorithm/Pseudocode:
Start Program
Include necessary libraries: ,,
Display Main Menu
Display the following options:
P[rogram Overview] T[emp Conversion] Q[uit]
Prompt the user to select an option (P, T, or Q).
User Input (Menu Option)
Read the user's input (choice).
Use a switch statement to handle different cases for the input:
If the user selects 'P' or 'p':
Call the function prog_Description().
If the user selects 'T' or 't':
Call the function convert(double TempMIN, double TempMAX, char type).
If the user selects 'Q' or 'q':
Exit the program.
Program Overview (prog_Description Function)
Function Definition: void prog_Description()
Display:
Program objectives
Explain that the user can convert temperatures between Celsius and Fahrenheit.
Explain how to navigate the menu and use conversion options.
Return to the main menu after displaying the description.
Temperature Conversion (convert Function)
Function Definition: void convert(double TempMIN, double TempMAX, char type)
Get User Input:
Prompt the user to enter TempMIN and TempMAX values.
Prompt the user to enter the conversion type ('C' or 'F').
Convert Based on Type:
If type is 'C' or 'c':
Convert the temperature from Fahrenheit to Celsius for all values between TempMIN and TempMAX using the formula:
C =5/9*(F -32)
If type is 'F' or 'f':
Convert the temperature from Celsius to Fahrenheit for all values between TempMIN and TempMAX using the formula:
F =(9/5)* C +32
Display Results:
Use looping (for loop) to iterate over all temperature values between TempMIN and TempMAX.
For each value, display the converted temperature, formatted with two decimal places (using ).
Return to the main menu after conversion.
Quit Program
If the user selects 'Q' or 'q', terminate the program.
Loop Menu Until Quit
Use a do-while loop to continuously show the menu until the user selects 'Q' or 'q'.
End Program

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 Programming Questions!