(Debug) Rewrite Program by using a character variable for the select code.
Program:
#includeusing namespace std;int main(){int opselect;double fnum, snum;cout << “Please type in two numbers: ”;cin >> fnum >> snum;cout << “Enter a select code: ”;cout << “\n 1 for addition”;cout << “\n 2 for multiplication”;cout << “\n 3 for division : ”;cin >> opselect;switch (opselect){case 1:cout << “The sum of the numbers entered is ” << fnum+snum;break;case 2:cout << “The product of the numbers entered is ” << fnum*snum;break;case 3:cout << “The first number divided by the second is ” << fnum/snum;break;} // end of switchcout << endl;return 0;}
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.