Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Develop a flowchart and then write a menu-driven C++ program that uses selection

ID: 640551 • Letter: D

Question

Develop a flowchart and then write a menu-driven C++ program that uses selection constructs to solve the following problem. You are not allowed to use any looping construct on this assignment.

Upon execution of the program, the program displays a menu as shown below and the user is prompted to make a selection from the menu.

The menu options are shown below.

Help                       Integers                                Floates                  Quit              

Once the menu selection is made, the program validates acceptable inputs and proceeds with processing that selection as explained below.

If the user selects h or H, a brief help screen will be displayed for the user. The help should tell the user how the program operates and what is needed from the user and how to terminate the program.

Once the user viewed the help screen, striking any key will terminate the program.

If the user selects i or I, the user is prompted for two integers. The program computes and displays the two operands and the result (the product of the two integers) with appropriate labels. If the two integer data are 5 and 3, then the result is displayed as shown below (note the required spacing between the operands and the operators).

The product of    5 * 3 =   15

Use a field width of 5, right justified for displaying the integer result.

Once the user observed the result, striking any key will terminate the program.

If the user selects f or F, the user is prompted for the two floats. The program computes and displays the two operands and the result (the quotient of the two floats) with appropriate labels. If the two float data are 2 and 4, then the result is displayed as shown below (note the required spacing between the operands and the operators).

The quotient of    2.000 / 4.000 = 0.500

Use appropriate formatting flags to show three digits after the decimal point.

Once the user observed the result, striking any key will terminate the program.

If the user selects q or Q, the program displays a message of your choice before terminating the program. An example would be a message like:

The program is terminated per user request

Explanation / Answer

#include void showChoices(); float add(float, float); float subtract(float, float); float multiply(float, float); float divide(float, float); int main() { float x, y; int choice; do { showChoices(); cin >> choice; switch (choice) { case 1: cout > x >> y; cout