Question: Using C++ Create a FUNCTION that contains a switch statement that simulates a simple calculator. Repeatedly call this function with a Do While loop, prompting

Using C++

Create a FUNCTION that contains a switch statement that simulates a simple calculator.

Repeatedly call this function with a Do While loop, prompting for a new operator and integer, until the calculator returns 0, in which case the program will close.

I created the entire program without a function, but it became clear that my professor was seeking a function. I took a cop out, and essentially just made the entire program a function and called it once in another .cpp file, but, as i expected, that wasn't acceptable either.

I need help reformatting this so the calculator function is within the Do while loop, and then we're passing in the original data, and it continually updates the variables until it returns 0 and closes.

Using C++ Create a FUNCTION that contains a switch statement that simulates

int calculatorO char op; double inl, in2; cout "Enter an operator, either +, -, *, / : "

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!