Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a simple calculator program that adds, subtracts, multiplies and divides.

ID: 3617220 • Letter: W

Question

 Write a simple calculator program that adds, subtracts, multiplies and divides. When
the program is run, it initiliazes the result to 0. The user can then type in an operator
and number. The result is updated and displayed. The following operators are valid:

Operator Meaning
--------------------------------
+ Addition
- Subtraction
* Multiplication
/ Division
---------------------------------

Handle the case when the user enters q or Q to quit and h or H for usage help.

Example output:

Result: 0
Enter operator from the table below, Q or q for quit, H or h for help :

Operator Meaning
======== =======
+ Add
- Subtract
* Multiply
/ Divide
+
Enter the value : 23
0 + 23
Result: 23
Enter operator from the table below, Q or q for quit, H or h for help :

/
Enter the value : 0
Error:Divide by zero. Operation ignored
Result: 23
Enter operator from the table below, Q or q for quit, H or h for help :

Operator Meaning
======== =======
+ Add
- Subtract
* Multiply
/ Divide
*
Enter the value : 3
23 * 3
Result: 69
Enter operator from the table below, Q or q for quit, H or h for help :


Operator Meaning
======== =======
+ Add
- Subtract
* Multiply
/ Divide
-
Enter the value : 56
69 - 56
Result: 13
Enter operator from the table below, Q or q for quit, H or h for help :

Operator Meaning
======== =======
+ Add
- Subtract
* Multiply
/ Divide
/
Enter the value : 4
13 / 4
Result: 3.25
Enter operator from the table below, Q or q for quit, H or h for help :

Operator Meaning
======== =======
+ Add
- Subtract
* Multiply
/ Divide

u

Invalid Entry! Please retry.
Enter operator from the table below, Q or q for quit, H or h for help :

Operator Meaning
======== =======
+ Add
- Subtract
* Multiply
/ Divide
h
Use '+' to add a value to the result ( 3.25 ),
Use '-' to subtract a value from the result ( 3.25 ),
Use '*' to multiply a value with the result ( 3.25 ),
Use '' to divide a value into the result ( 3.25 ),
Result: 3.25
Enter operator from the table below, Q or q for quit, H or h for help :

Operator Meaning
======== =======
+ Add
- Subtract
* Multiply
/ Divide
q
Thank you for using our calculator. Come back again :-)

Explanation / Answer

please rate - thank #include #include using namespace std; void help(float); float compute(float,float,char); float enter_operand(); char enter_code(); int main() {float num2,accum=0; char oper; for(;;) {     cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote