Write a Program that models a simple calculator. Each data entry line should consist of a valid operator (from the list below), and the right-hand operand. Assume that the left-hand operand is the accumulated value in the calculator, with an initial value of 0.0.
Acceptable operators:
+ ..Add
- ..Subtract
* ..Multiply
/ ..Divide
^ ..Power (raise left operand to the power of the right operand)
q or = ..Quit
Your Calculator should display the accumulated value after each operation. A sample run might be:
+ 5.0
Result so far is 5.00
^ 2
Result so far is 25.00
/ 2.0
Result so far is 12.50
Q 0
The final result is 12.50
Include (define and call) at least THREE functions:
a function that displays instructions to the user.
a function do_next_op() that has 3 input parameters (the operator, the operand, and the current accumulated value), and returns the new value for the accumulated value. An alternative implementation may use 2 input parameters (operator and operand), and 1 input/output parameter (the accumulated value)
at least one other function - of your choice! Make sure that it does something useful.