I saw this piece of code which I tought was interesting. However, since i'm new o programming can someone please provice the 3 column IPO chart including the Algorithm.Thank you for an urgent response.
int main()
{
// Declare variables below here
double x, z, result;
char operand;
// Initialization Section for real number output. DO NOT MOVE!
cout <<setiosflags(ios::fixed | ios::showpoint);
cout <<setprecision(2);
// Begin your "main processing" below here
cout <<"Welcome to the mathematical selector program!"<<endl;
do
{
cout <<"Please enter the operand of the problem you would like to solve:"<<endl;
cout <<"+ for addition"<<endl;
cout <<"- for subtraction"<<endl;
cout <<"* for multiplication"<<endl;
cout <<"/ for division"<<endl;
cout <<"Enter Q to quit"<<endl;
cout <<"Enter your choice ==> ";
cin>> operand;
switch (operand)
{
case 'Q':
break;
case '+':
cout <<"Please enter the two numbers ==> ";
cin >> x >> z;
result = x+z;
cout <<"The answer is: " << result <<endl;
break;
case '-':
cout <<"Please enter the two numbers ==> ";
cin >> x >> z;
result = x-z;
cout <<"The answer is: " << result <<endl;
break;
case '*':
cout <<"Please enter the two numbers ==> ";
cin >> x >> z;
result = x*z;
cout <<"The answer is: " << result <<endl;
break;
case '/':
cout <<"Please enter the two numbers ==> ";
cin >> x >> z;
if (z ==0 )
{
cout <<"That is an invalid operation" <<endl;
}
else
{
result = x/z;
cout <<"The answer is: " << result <<endl;
}
break;
default :
cout <<"That is an invalid operation" <<endl;
break;
}
}while (operand != 'Q');
cout <<"End of Program!"<<endl;