#include <iostream>
usingnamespace std;
int main()
{
char operation;
double number;
double number2;
double total;
cout << "This is a calculator where you have to enter the problem in the order you want it solved. \n";
cout << "Enter the first number in the problem: ";
cin >> number;
cout << "\n Now enter the operation: ";
cin >> operation;
cout << "\n Now enter the second number: ";
cin >> number2;
switch(operation){
case'+':
total = number + number2;
cout << " \nYour current total is: " << total;
break;
case'-':
total = number - number2;
cout << " \nYour current total is: " << total;
break;
case'*':
total = number * number2;
cout << " \nYour current total is: " << total;
break;
case'/':
total = number / number2;
cout << " \nYour current total is: " << total;
break;
}
label:
cout << " \n Now enter the next operation or enter 1 if your problem is already solved: ";
cin >> operation;
cout << "\n Now enter the next number: ";
cin >> number;
switch(operation){
case'+':
total = total + number;
cout << " \nYour current total is: " << total;
break;
case'-':
total = total - number;
cout << " \nYour current total is: " << total;
break;
case'*':
total = total * number;
cout << " \nYour current total is: " << total;
break;
case'/':
total = total / number;
cout << " \nYour current total is: " << total;
break;
}
goto label;
return 0;
}