I would have no clue how to do that.. xD
This is a discussion on Need help learning C++. within the C++ Programming forums, part of the General Programming Boards category; I would have no clue how to do that.. xD...
I would have no clue how to do that.. xD
would you like a clue?
indeed
If you need this explaining, then please ask.Code:#include <iostream> using namespace std; int main() { int age; char ans; do { cout<<"Please input your age : "; cin>> age; cin.ignore(); if ( age < 5 || age == 5 ) { cout<<"Are you potty trained yet?!\n"; } else if ( age > 5 && age < 12 || age == 12 ) { cout<<"Woo! You're maturing.\n"; } else if ( age > 12 && age < 20 ) { cout<<"You're a teenager, welcome to hell.\n"; } else if ( age > 21 && age< 30 ) { cout<<"Party it up, you can drink, your prolly in college, or just out of it. Have fun.\n"; } else if ( age == 20 ) { cout<<" You are the ........tiest age ever. You are in college, alot of work.. and you can't drink yet. Hold int here one more year.\n"; } else if ( age > 30 && age < 40 || age == 30 || age == 40) { cout<<"You are getting towards middle aged, start to settle down.\n"; } else if ( age > 40 && age < 47 ) { cout<<"You're now middle aged. Get used to it.\n"; } else if ( age == 47 ) { cout<<"I love you mom!!!!!\n"; } else if ( age > 100 || age == 100 ) { cout<<"Plan your funeral, make sure your will is correct, etc.\n"; } else if ( age > 47 && age < 60 ) { cout<<"You're getting up there in years!!!\n"; } else if ( age > 60 || age == 60 && age < 100 ) { cout<<"You're old.\n"; } cout<<"Continue (y/n)"<<endl; cin>>ans; }while(ans!='n'); cin.get(); }![]()
thanks i get it.
Now that I'm done I was wondering if I wanted to give an answer like.
"you are ___ (whatever they entered) years young."
how would I do something like that?
Code:cout<<"you are "<< age << " years young."<< endl;