Help please!!!

this is what i have to do but i really dont know where to start... thanks for any help

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 addIntegers subDoubles 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 follow with the display of the menu again.

If the user selects a or A, the user is prompted for two integers. The program computes and displays the two operands and the result (sum of the two integers) with appropriate labels. If the two integer data are 15 and 30, then the result is displayed as shown below.

The sum of 15 + 30 = 45

Use a field width of 6, right justified for displayed information.

Once the user observed the result, striking any key will follow with the display of the menu again.

If the user selects d or D, the user is prompted for two doubles. The program computes and displays the two operands and the result (difference between the two doubles) with appropriate labels. If the two double data are 20 and 40, then the result is displayed as shown below.

The difference of 20.00 – 40.00 = -20.00

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

Once the user observed the result, striking any key will follow with the display of the menu again.

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…
Any other menu item must be flagged as error and the user is warned to select items from the menu and the menu is displayed again. The wrong input should not terminate the program.

Once the program begins execution, it will not terminate until the user inputs q or Q.
I believe I (and others) will be much more willing to help if you post some sort of attempt at it. Even if it doesn't work.

I would make a char to store the user's inputs.
And I would put everything inside a while-loop as such:

1
2
3
4
5
6
char input = 'x';//Random value to activate the while-loop.
while ( input != 'Q' && input != 'q'){

//some codes go here
//This while-loop will run until user inputs 'q' or 'Q'.
}

Last edited on
Topic archived. No new replies allowed.