#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <string>
using namespace std;
int main()
{
string a;
int first;
int second;
int third;
int four;
int five;
int six;
int seven;
int eight;
int nine;
int ten;
int eleven;
string answer;
begin:
system("title my first calculator");
cout<<"multiply for multiplication"<<endl;
cout<<"addme for addition"<<endl;
cout<<"divide for division"<<endl;
cout<<"and subtract for subtraction: "<<endl;
": ";
cin>>a;
if(a !="addme")
if(a !="subtract")
if(a !="multiply")
if(a !="divide")
{
cout<<"invalid command.."<<endl;
goto name;
}
if(a == "divide")
{
cout<<"first number to be divided: ";
cin>> first;
cout<<"second number to be dividied: ";
cin>>second;
cout<<""<<first<<"/"<<second<<"="<<first/second<<""<<endl;
}
if(a == "addme")
{
cout<<"first number to be added"<<endl;
cin>>first;
cout<<"second number to be added"<<endl;
cin>>second;
cout<<"third number to be added"<<endl;
cin>>third;
cout<<"fourth number to be added"<<endl;
cin>>four;
cout<<"fifth number to be added"<<endl;
cin>>five;
cout<<"sixth number to be added"<<endl;
cin>>six;
cout<<"seventh number to be added"<<endl;
cin>>seven;
cout<<"eighth number to be added"<<endl;
cin>>eight;
cout<<"ninth number to be added"<<endl;
cin>>nine;
cout<<"tenth number to be added"<<endl;
cin>>ten;
cout<<"eleventh number to be added"<<endl;
cin>>eleven;
cout<<""<<first<<"+"<<second<<"+"<<third<<"+"<<four<<"+"<<five<<"+"<<six<<"+"<<seven<<"+"<<eight<<"+"<<nine<<"+"<<ten<<"+"<<eleven<<"="<<first+second+third+four+five+six+seven+eight+nine+ten+eleven<<""<<endl;
}
if(a == "multiply")
{
cout<<"first number to be multiplied: ";
cin>>first;
cout<<"second number to be multiplied: ";
cin>>second;
cout<<""<<first<< "*" <<second<< "=" <<first*second<< ""<<endl;
}
if(a == "subtract")
{
cout<<"first number to be subtracted: ";
cin>>first;
cout<<"second number to be subtracted: ";
cin>>second;
cout<<""<<first<< "-" <<second<< "=" <<first-second<< ""<<endl;
}
name:
cout<<"for another calculation type new to exit type exit: ";
cin>>answer;
if(answer == "new")
{
system("CLS");
goto begin;
}
if(answer == "exit")
{
system("CLS");
system("EXIT");
}
if(answer !="exit")
if(answer !="new")
{
cout<<"enter either NEW or EXIT"<<endl;
goto name;
}
system("PAUSE");
}