Question: #include #include using namespace std; int main() { float op1; float op2; float result; int c; cout < < please type in your choice -

#include
#include
using namespace std;
int main() {
float op1;
float op2;
float result;
int c;
cout cin >> c;
switch (c) {
case 1:
float num1;
float num2;
cout cin >> num1;
cout cin >> num2;
cout
case 2:
num1;
num2;
cout cin >> num1;
cout cin >> num2;
cout
case 3:
num1;
num2;
cout cin >> num1;
cout cin >> num2;
cout
case 4:
num1;
num2;
cout cin >> num1;
cout cin >> num2;
cout
case 5:
const int fixed = 20;
num1;
num2;
cout cin >> num1;
for (int i = 1; i cout cout }
}
return 0;
}
QUESTION Using the code below complete the following tasks: 1) Analyse the code and modify the program so that it uses an objected orientated approach to solving the problem. The modified program should include: Appropriate class name Appropriate member variables Appropriate member functions 2) The code in question 1 produces exceptions (crashes) when inappropriate values are entered. Modify your code by adding error correction to ensure the program does not crash regardless of what values are entered. 3) Modify your code to ensure the user is presented with a menu system which allows the user to select different calculator functions and repeat if desired.
Step by Step Solution
There are 3 Steps involved in it
Here is the modified code using an objectoriented approach error handling and a menu system cpp incl... View full answer
Get step-by-step solutions from verified subject matter experts
