Problem

(Debug) Rewrite Program by using a character variable for the select code.Program:#include...

(Debug) Rewrite Program by using a character variable for the select code.

Program:

#include using 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;}

Step-by-Step Solution

Request Professional Solution

Request Solution!

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.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 4.4