Thanks, peaceofpi. That was helpful and I've fixed my problem; yes I want to get deeper and more complicated in this simple program I have built.
#include <iostream>
#include <string>
using namespace std;
int main(void)
{
system("TITLE Addition");
system("COLOR 3");
int number1;
int number2;
int number3;
int number4;
int sum;
int one = 1;
string yesno;
string relay;
while (true)
{
cout<<"I'm going to add these numbers you give me. First Number: ";
cin>>number1;
cout<<"next number: ";
cin>>number2;
cout<<"and the next number: ";
cin>>number3;
cout<<"and the last number: ";
cin>>number4;
sum=(number1+number2+number3+number4);
if(sum < 10) {
relay = "small";
cout<<"Your number is " << sum << " and it is a " << relay << " number. \n";
}
else if ( sum > 10 && sum < 50 ) {
relay = "big";
cout<<"Your number is " << sum << " and it is a " << relay << " number. \n";
}
else if (sum > 50 && sum <150 ) {
relay = "large";
cout<<"Your number is " << sum << " and it is a " << relay << " number. \n";
}
else {
cout<<"You have a really big number \n" ;
}
cout<<"Try again? Y/N: ";
cin>> yesno;
if (yesno == "Y") {
return 0;
}
else if (yesno == "N") {
system("pause");
}
}
}
As you see here, I have added a "Try Again?" question at the end of the program. I have ran into a problem, though. When I type in "Y" it simply exits the program. When I type in "N" it asks me to press any key to continue, and then it starts the program over again.
But what I have done is basically reversed the Y/N if statements:
if (yesno == "Y") {
system("pause");
}
else if (yesno == "N") {
return 0;
which works perfectly.