#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <string>
using namespace std;
int main()
{
string a;
int first;
int second;
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<<"";
}
if(a == "addme")
{
cout<<"first number to be added"<<endl;
cin>>first;
cout<<"second number to be added"<<endl;
cin>>second;
cout<<""<<first<<"+"<<second<<"="<<first+second<<""<<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");
}
system("PAUSE");
}