#include <iostream>
#include <string>
using namespace std;
int main()
{
string operation;
int userinput;
double total=0;
double num;
cout << "Welcome to Big People's Calculator"<< endl;
cout <<"" << endl;
//while ()
cout << "which operation would you like to use? (addition,subtract,multiply,divide)" << endl;
cin >> operation;
cout << "How many numbers would you like to use?" << endl;
cin >> userinput;
if (operation=="addition"||operation=="Addition"||operation=="ADDITION") {
for (int x=0;x<userinput;total=total+num ){
cout << "Please enter the number you would like to use" << endl;
cin >> num;
x++;
}
}
else if (operation=="subtract"||operation=="subtract"||operation=="SUBTRACT") {
for (int x=0;x<userinput;total=total-num ){
cout << "Please enter the number you would like to use" << endl;
cin >> num;
x++;
}
}
else if (operation=="multiply"||operation=="Multiply"||operation=="MULTIPLY") {
for (int x=0;x<userinput;total=total*num ){
cout << "Please enter the number you would like to use" << endl;
cin >> num;
x++;
}
}
else if (operation=="DIVIDE"||operation=="divide"||operation=="Divide") {
for (int x=0;x<userinput;total=total/num ){
cout << "Please enter the number you would like to use" << endl;
cin >> num;
x++;
}
}
cout << "This is your total " << total << endl;
else
{
cout << "You are not part of big people" << endl;
}
return 0;
}
#include <iostream>
#include <string>
usingnamespace std;
int main()
{
string operation;
int userinput;
double total=0;
double num;
cout << "Welcome to Big People's Calculator"<< endl;
cout <<"" << endl;
//while ()
cout << "which operation would you like to use? (addition,subtract,multiply,divide)" << endl;
cin >> operation;
cout << "How many numbers would you like to use?" << endl;
cin >> userinput;
if (operation=="addition"||operation=="Addition"||operation=="ADDITION")
{
for (int x=0;x<userinput;total=total+num )
{
cout << "Please enter the number you would like to use" << endl;
cin >> num;
x++;
}
}
elseif (operation=="subtract"||operation=="subtract"||operation=="SUBTRACT")
{
for (int x=0;x<userinput;total=total-num )
{
cout << "Please enter the number you would like to use" << endl;
cin >> num;
x++;
}
}
elseif (operation=="multiply"||operation=="Multiply"||operation=="MULTIPLY")
{
for (int x=0;x<userinput;total=total*num )
{
cout << "Please enter the number you would like to use" << endl;
cin >> num;
x++;
}
}
elseif (operation=="DIVIDE"||operation=="divide"||operation=="Divide")
{
for (int x=0;x<userinput;total=total/num )
{
cout << "Please enter the number you would like to use" << endl;
cin >> num;
x++;
}
}
//cout << "This is your total " << total << endl;
else
{
cout << "You are not part of big people" << endl;
}
return 0;
}