//My Calculator
#include <iostream>
usingnamespace std;
int main(){
string name1;
int choice = 0;
int sum;
int totalsum = 0;
int sum2;
int totalsum2 = 0;
int sum3;
int totalsum3 = 0;
int sum4;
int totalsum4 = 0;
cout << "Hi user whats your name: "<< name1 << endl;
cin >> name1;
cout << name1 << " you want to:\n1.Add\n2.Subtract\n3.Multiply\n4.Division"<< endl;
cin >> choice;
switch(choice)
case 1:
cout <<"What you want to add: ";
cin >> sum;
while(0<sum){
totalsum = totalsum + sum;
cout<<"What is your next number to add or -1 to quit: ";
cin >>sum;
break;
}
cout <<"Your total is : "<<totalsum << endl;
\
case (2):
cout <<"What you want to subtract: ";
cin >> sum2;
while(0<sum2){
totalsum2 = totalsum2 - sum2;
cout<<"What is your next number to subtract or -1 to quit: ";
cin >>sum2;
break;
}
case (3):
cout <<"What you want to multiply: ";
cin >> sum3;
while(0<sum3){
totalsum3 = totalsum3 * sum3;
cout<<"What is your next number to multiply or -1 to quit: ";
cin >>sum3;
break;
}
case (4):
cout <<"What you want to divide: ";
cin >> sum4;
while(0<sum4){
totalsum4 = totalsum4 / sum4;
cout<<"What is your next number to divide or -1 to quit: ";
cin >>sum4;
break;
}
default:
cout <<"That is 4 choice there."<< endl;
}
}
"Do stuff" means whatever it is that you want to happen in that particular case. I'm not writing the code for you - I'm demonstrating the correct syntax for a switch/case statement.