Question
Write a C/C++ program to simulate a simple calculator. See the figure below for example output. The program must conform to the following specifications: The
Write a C/C++ program to simulate a simple calculator. See the figure below for example output.
The program must conform to the following specifications:
The program must show a menu and prompt the user to choose the desired operation (from 1 to 5). The menu must be displayed with a function displaymenu() - Receives no arguments and does not return a result The program then asks the user to input two integer values for the calculation. Write the following functions to facilitate the operations and return the result to the calling statement in main(): Add() - Receives two integer arguments and returns an integer result; Substract() - Receives two integer arguments and returns an integer result; Multiply() - Receives two integer arguments and returns an integer result; Divide() - Receives two integer arguments and returns a real result; and Modulus() - Receives two integer arguments and returns an integer result. The program must ask the user whether they want to continue with another calculation. If not, the program terminates. Use all the functions in main() to create a working program.
efundin u ac.za/portal site/cbfece 19 /0e1 4b/b 9ac5 9e3c648e5ac4/tool -) Not secure Moduius Receives two integer anuments and returns an integer resuIt The program must ask the user whether they want to continue with another calculat Use all the functions in maino to create a working proor ram HENU .Add 2.Subtract 3.Multiply 4.Divide 5.Modulus Enter your choice(1-5):1 Enter integer number 1:5 Enter integer number 2:3 Result:8 Press y or Y to continue:y MENU 1.Add 2.Subtract 3.Multiply 4.Divide 5.Modulus Enter your choice(1-5):4 Enter integer number 1:5 Enter integer number 2:3 Result:1.67 Press y or Y to continue:n Process returned e (x) execution time 36.152 s Press any key to continue
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started