You are going to create a simple calculator. 1. The program should call a function to display a menu of three options: a. 1-Integer Math b. 2-Double Math c. 3- Exit Program 2. The program must test...


You are going to create a simple calculator.<br>1. The program should call a function to display a menu of three options:<br>a. 1-Integer Math<br>b. 2-Double Math<br>c. 3- Exit Program<br>2. The program must test that the user enters in a valid menu option. If they do not, the program must<br>display an error message and allow the user to reenter the selection. Once valid, the function must<br>retum the option selected.<br>3. If the user selects 1 or 2, the program should allow the user to enter in any two numbers.<br>a. The program must create 5 functions called add, subtract, multiply, divide and mod. These<br>functions must take two integers as arguments and retum an integer to the calling function.<br>Each function performs the appropriate mathematical task.<br>b. The program must create 4 functions called add, subtract, multiply and divide. These<br>functions must take two doubles as pass by value parameters and one double as a pass by<br>reference variables. The function does the calculation and scts the reference variable to the<br>calculated value; this is how the value is returned to the calling function. Each function<br>performs the appropriate mathematical task.<br>c. The program must create two functions called display.<br>i. The first display function takes the five integer values calculated and displays them<br>ii. The second display function takes the four double values calculated and display<br>them to two decimal places<br>

Extracted text: You are going to create a simple calculator. 1. The program should call a function to display a menu of three options: a. 1-Integer Math b. 2-Double Math c. 3- Exit Program 2. The program must test that the user enters in a valid menu option. If they do not, the program must display an error message and allow the user to reenter the selection. Once valid, the function must retum the option selected. 3. If the user selects 1 or 2, the program should allow the user to enter in any two numbers. a. The program must create 5 functions called add, subtract, multiply, divide and mod. These functions must take two integers as arguments and retum an integer to the calling function. Each function performs the appropriate mathematical task. b. The program must create 4 functions called add, subtract, multiply and divide. These functions must take two doubles as pass by value parameters and one double as a pass by reference variables. The function does the calculation and scts the reference variable to the calculated value; this is how the value is returned to the calling function. Each function performs the appropriate mathematical task. c. The program must create two functions called display. i. The first display function takes the five integer values calculated and displays them ii. The second display function takes the four double values calculated and display them to two decimal places

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here