Question: Calculator revisited (calc.c) Write a four function calculator (+,-,*,/) that works with an arbitrary number of inputs. This means that instead of just taking two
Calculator revisited (calc.c) Write a four function calculator (+,-,*,/) that works with an arbitrary number of inputs. This means that instead of just taking two inputs it takes numbers and operations until the user decides to quit (the program runs in an infinite loop). Give updates on the current total after each operation and allow the user the choice to continue or choose a new operation each time. Total starts at 0.0 and the menu choice 5 is used to signal end of computation. Place the add, subtract, multiply, and divide functionality inside independent functions.
Implement these functions:
double add(double sum, double value);
double subtract(double sum, double value);
double multiply(double sum, double value);
double divide(double sum, double value);
THE OUTPUT SHOULD BE SOMETHING LIKE THIS:

Language in C
1 add 2: subtract 3: multiply 4 divide 5: quit enter number to add: Total is: 5.000000 1 add 2: subtract 3: multiply 4 divide 5: quit enter number to multiply Total is 25.000000 1 add 2: subtract 3: multiply 4 divide 5: quit enter number to divide can not divide by 0, ignoring value and continuing Total is 25.000000 1 add 2: subtract 3: multiply 4 divide 5: quit Final total is: 25.000000
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
