Question. Write a program which allows the user to perform simple tasks on a calculator. A series of functions allows the user to select an operation to perform and then enter operands.
The first function displays a menu, giving the user the choice of typing in any one of the following:
+, -, *, /, or % representing the usual arithmetic operators
A representing the average of two numbers
X representing the maximum of two numbers
M representing the minimum of two numbers
S representing the square of a number
Q indicating the user wants to quit the program
The program reads the user's response into a variable of type char. Using a switch statement or a series of if statements, the program determines what function to call to process the user's request. For example, if the user enters +, another function asks for two integers. Then it finds the sum of the two integers. If the user enters X, a function asks for two integers and finds the larger of the two. If the user enters S, a function asks for one value and finds the square of that value. If the user enters Q, the program stops.
For each and every calculation performed, the program like the function prints the user's original input and the result.