CIS3355:
Business Data Structures |
Program Controls This is a simple program, which puts some additional controls on the previous program you wrote. The last program allowed the user to enter 'illegal' choices (i.e., something other than '1' through '8'). You are to stop the user from doing that. How?? As you will recall, your previous program had the section of code: void main() Which displayed the menu and got the user input. You should change this section of code to: void main() Notice you will have to change your function checkchoice
so that it returns a value: You will also have to change function displaymenu to look
like: void displaymenu() There is one additional choice, namely the last one: cout << " 0. Quit this program\n\n"; This allows the user to continue rerunning the program until they decide to quit How will this change the program? Not really by much. You will notice that we started the program with a do statement. We know that a do ...while is an entry level check. The while component will go at the end of the main function, and will simply be: } while (menuchoice != '0'); The only caution I would give you is to watch your begin and end ellipses. Have fun |