Wap which will act as a simple four-function calculator


Problem:

Question- Write a program, which will act as a simple four-function calculator. That is it will read a number, read an operator, read another number, then do the operation. The calculator works with integers and uses four functions: +, -, *, and /.

After the first operation is completed, the program will read another operator and uses the result of the previous operation as the first value for the next operation. If the user enters a C the result is cleared and then the user starts entering a new number. If the user enters an X, the calculator is turned off.

The various input values (i.e. numbers, operators, commands) will be followed by the ENTER key. Your program should prompt the user on what the user is to do. The commands C and X may be entered in place of an operator. All numbers entered and displayed will be integer values.

Show the code, demonstrate it works properly and describe what it is doing.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Wap which will act as a simple four-function calculator
Reference No:- TGS0893221

Expected delivery within 24 Hours