hey new bies check this out
im a newbie to
i have just come up with a really funny program
if u enter ur age below 17 it says ur at a cool age ( cos im 15) if u enter ur age above 20 its says your ancient (carries on) if u enter in between 17 and 20 it will say not to old i suppose
enter this nect code and compile tell me what u think
experts tell me what i can do to improve or change it slightly to be funnier please
thanx
crap i forgot the code
here u go
#include <iostream.h>
using namespace std;
int main()
{
int age;
cout<<"please input your age: ";
cin>> age;
cin.ignore();
if ( age < 17 ) {
cout<<"you are at a cool age\n";
}
else if ( age > 20 ) {
cout<<"whoah your ancient how good a mate was jesus at school\n";
cout<<"only joking\n";
}
else {
cout<<"not to old i suppose\n";
}
cin.get();
}
me stupid i forget the most important bit derrr
here u go
#include <iostream.h>
using namespace std;
int main()
{
int age;
cout<<"please input your age: ";
cin>> age;
cin.ignore();
if ( age < 17 ) {
cout<<"you are at a cool age\n";
}
else if ( age > 20 ) {
cout<<"whoah your ancient how good a mate was jesus at school\n";
cout<<"only joking\n";
}
else {
cout<<"not to old i suppose\n";
}
cin.get();
}
me stupid i forget the most important bit derrr
Well, somebody's going to point it out sooner or later:
Use
The STL headers without ".h" are the newer standard.
Use
#include <iostream>
not#include <iostream.h>
The STL headers without ".h" are the newer standard.
Hmmm.... Jesus was pretty cool, I guess. Always changing my chocolate milk into vodka for me and all.
While people are pointing things out, I might as well let you know that it's 'too', not 'to' in the sentence "Not too old, I suppose." ;)
CanI safely assume that if I enter 15, your program will say "doodz, u rulz0rz teh l4zy l337-like sms 2p34k wihc is unradabel by teh ancient".
This is a forum, you have some time to type your text before anyone will answer, and believe it or not, but you are (not 'your', remember this) allowed to use this time to write more correct English sentences.
Anyway, you should replace those "\n" with std::endl, just like in this statement:
And jesus was cool. Well, he ued to drink too much, but he was cool.
Regards,
This is a forum, you have some time to type your text before anyone will answer, and believe it or not, but you are (not 'your', remember this) allowed to use this time to write more correct English sentences.
Anyway, you should replace those "\n" with std::endl, just like in this statement:
std::cout << "whoah your ancient how good a mate was jesus at school" << std::endl;
And jesus was cool. Well, he ued to drink too much, but he was cool.
Regards,
sorry about not talking proper english
and no it dosnt say any thing when you type 15 im working on it ill post it on here when its fully done this is just a prototype
and no it dosnt say any thing when you type 15 im working on it ill post it on here when its fully done this is just a prototype
Putting a little more effort into your grammar would be nice.
To which I might reply
Quote:
I'm a newbie, too. I have just came up with a really funny program.
If you enter an age below 17 it says you're at a cool age, and if you enter an age above 20 it says you're ancient. If you enter an age between 17 and 20 it will say "not to old i suppose".
Compile this code and tell me what you think. Please tell me what I can do to improve it or make it funnier. Thanks.
To which I might reply
#include <iostream>#include <limits>using namespace std;int main() { int age; cout<<"Please input your age: "<<flush; if(cin>>age) { if(age <= 5) cout<<"Why do I not believe you?"; else if(age <= 16) cout<<"That's a cool age."; else if(age <= 20) cout<<"That's about average I suppose."; else if(age <= 90) cout<<"Woah! You're ancient!\nOnly joking."; else cout<<"Why aren't you dead yet?"; } else cout<<"I have no idea what that means."; cin.ignore(numeric_limits<int>::max(), '\n'); cout<<"\n\nPress enter to quit."<<endl; cin.get(); }
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement