C++
pls double check instruction
do not copy paste other code
pls explain your choice or code with//comments
thanks
Task 2: Accumulative calculator Write a program to model a simple calculator. Each data line should consist of the next operation to be performed from the list below and the right operand. -Write a function called get_input that gets the inputs from user and has two output parameters (i.e. call by reference parameters) that return an operator and an operand scanned from the user. -Write a function called do_next_op that performs the required operation. do_next_op has two input parameters (the operator and operand) and one input/output parameter (the accumulator). The valid operators are: + add * subtract ^ multiply / divide power (raise left operand to the power of right operand) q quit Your calculator should display the accumulator value after each operation. A sample run follows. Starting the calculator. Enter [command operand]: + 5.0 result so far is 5.0 ^2 result so far is 25.0 / 2.0 result so far is 12.5 90 final result is 12.5
C++ pls double check instruction do not copy paste other code pls explain your choice or code with //comments thanks
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am