Question: Modify the Program so that one (1) of the five (5) cases in your switch statement loops until proven false. #include using namespace std; int

Modify the Program so that one (1) of the five (5) cases in your switch statement loops until proven false.

#include

using namespace std;

int main()

{

char a;

float number1, number2;

cout << "Enter an operator (+, -, *, /): ";

cin >> a;

cout << "Enter two operands: ";

cin >> number1 >> number2;

switch (a)

{

case '+':

cout << number1 << " + " << number2 << " = " << number1 + number2;

break;

case '-':

cout << number1 << " - " << number2 << " = " << number1 - number2;

break;

case '*':

cout << number1 << " * " << number2 << " = " << number1 * number2;

break;

case '/':

cout << number1 << " / " << number2 << " = " << number1 / number2;

break;

default:

cout << "Error! operator is not correct";

break;

}

return 0;

}

Modify the Program so that one (1) of the five (5) cases in your switch statement loops until proven false

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!