Question: (a) Develop a flowchart and then write a menudriven C++ program to solve the following problem. Upon execution of the program, the menu will be
(a) Develop a flowchart and then write a menudriven C++ program to solve the following problem. Upon execution of the program, the menu will be displayed, prop erly centered as shown below. You will be using Selection Constructs, the Looping Constructs, userdefined functions and references for this assignment.
Help Arithmetic Relational Logical Quit
Once the menu is displayed, the user is prompted for a menu selection. A wrong menu option is flagged as an error and the menu is displayed again. Note: The bold letters are for emphasis and is not part of the problem requirements.
H or h (for H elp) will call the function help which briefly explains the problem being solved and the purpose of each menu options. Once the user strikes a key, the menu will appear again.
A or a (for A rithmetic) will call a function arithmetic which prompts the user for two integer numbers followed by an arithmetic operati on to be performed according to the following convention. If the user inputs 1 for the operation, the addition operation will be performed. If the user inputs any other number, the program displays a message stating incorrect operation and then will clear the screen and shows the menu. If 1 is entered a gain, the steps above will be repeated. At no time the program should be terminated. You will decide the output format to be displayed. Once the user viewed the results, striking a key will display the menu and the user is prompted a gain for a menu selection. You can remain in this mode if you like by adding additional logic of your design.
R or r (for R elational) will call the function relational which prompts the user for two integer numbers followed by a relational operation to be performed according to the following convention. If the user inputs 1 for the operation, the less than (<) operation will be performed. If the user inputs any other number, the program displays a message stating incorrect operat ion and then will clear the screen and shows the menu. If 1 is entered again, the steps above will be repeated. At no time the program should be terminated. You will decide the output format to be displayed. Once the user viewed the results, striking a key will display the menu and the user is prompted again for a menu selection. You can remain in this mode if you like by adding additional logic of your design.
L or l (for L ogical) will call the function logical which prompts the user for two integer numbers followed by a logical operation to be performed according to the following convention. The parameter passing to this function will be references . If the user inputs 1 for the operation, the logical AND will be performed between the two integer numbers. If the user inputs any other number, the program displays a message stating incorrect operation and then will clear the screen and shows the menu. If 1 is entered again, the steps above will be repeated. At no time the program should be terminated. You will decide the output format to be displayed. Once the user viewed the results, striking a key will display the menu and the user is prompted again for a menu selection. You can remain in this mode if you like by adding additional logic of your design.
Q or q (for Q uit) will clear the screen and terminate the program.
Hints: 1. Your program will only have one main() function and many other userdefined functions as stated above. In addition to the main() function which must have a return statement, other functions may have return statements as well. There will be one .cpp file with multiple functions.
2. It is essential that function declarations (prototypes), definitions, and invocations follow the instructions given in class.
3. Make sure your program executes correctly
4. Make sure the variables are correctly declared without any conflicts with other variables. You may have to change some of the variables to make each variable unique.
5. Your program will terminate when the user selects Q or q.
6. Use conditional constructs, looping constructs, userdefined functions, and references for this assignment
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
