Hamumu Software Hamumu Software Hamumu Software
Name
Password Register
Latest Journal update: Oct 23, 2017
Old 12-12-2008, 04:52 PM   #1
fourwind
Lord of Blobs
 
fourwind's Avatar
 
Join Date: Apr 2008
Location: The Sunny meadows asylum.
Posts: 319
Default Guess what everyone?

Code:
#include <iostream>

using namespace std;

int main() //So important, it hurts.
{
    int age;               // Variable
    
    cout<<"Input your age: ";                                  //Imput that age
    cin>> age;                                                      //Get variable
    cin.ignore(); //NOT SURE
    if ( age < 21 ) {             //IF STATEMENTS WOOT!
           cout<<"You are not allowed to drink beer\n"; //NO BEER FOR YOU
    }
    else if ( age == 21 ) {
           cout<<"Go drink your first beer!\n";             //GO DRINK IT
    }
    else {
           cout<<"Go drink a beer!\n";                      //GO HAVE ANOTHER
           }
           cin.get();              //IMPORTANT
}

Yeah. Stick that in your compiler and...Compile it.
IM LEARNING C++!!! OH YEAH!!!!
I made that program...from scratch. I didn't copy anything. I LEARNED THE VARIABLES AND SUCH.
__________________
Fourwind


Last edited by fourwind; 12-12-2008 at 04:52 PM.
fourwind is offline   Reply With Quote
Old 12-12-2008, 05:15 PM   #2
TyTBone
College Boi
 
TyTBone's Avatar
 
Join Date: Oct 2007
Location: MD
Posts: 2,067
Default Re: Guess what everyone?

Quote:
Originally Posted by fourwind View Post
Code:
#include <iostream>

using namespace std;

int main() //So important, it hurts.
{
    int age;               // Variable
    
    cout<<"Input your age: ";                                  //Imput that age
    cin>> age;                                                      //Get variable
    cin.ignore(); //NOT SURE
    if ( age < 21 ) {             //IF STATEMENTS WOOT!
           cout<<"You are not allowed to drink beer\n"; //NO BEER FOR YOU
    }
    else if ( age == 21 ) {
           cout<<"Go drink your first beer!\n";             //GO DRINK IT
    }
    else {
           cout<<"Go drink a beer!\n";                      //GO HAVE ANOTHER
           }
           cin.get();              //IMPORTANT
}
Yeah. Stick that in your compiler and...Compile it.
IM LEARNING C++!!! OH YEAH!!!!
I made that program...from scratch. I didn't copy anything. I LEARNED THE VARIABLES AND SUCH.
Cool, but I thought you had said it was too hard and you were giving up?
__________________
Siggy!
(I just read the sig, what a throwback)
TyTBone is offline   Reply With Quote
Old 12-12-2008, 10:56 PM   #3
Ubernoob
Dumb Person
 
Ubernoob's Avatar
 
Join Date: May 2008
Location: Toronto
Posts: 759
Default Re: Guess what everyone?

C++ is fun. But you should try assembler if you really want things to get interesting.
__________________
Ubernoob is offline   Reply With Quote
Old 12-13-2008, 05:46 AM   #4
Mr.Onion
Evil, random-voting vegetable
 
Mr.Onion's Avatar
 
Join Date: Mar 2005
Location: Down at the shore where there's no-one vacationing.
Posts: 4,862
Default Re: Guess what everyone?

Code:
#!/bin/python
print "Input your age.";
age = input();
if age > 21:
	print "Go drink a beer."
else:
	if age == 21:
		print "Go drink your first beer."
	else:
		print "You're not allowed to drink beer."
input()
Python is awesome.
__________________
Mr.Onion is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mac Vs PC, I guess 8888196 Total Mayhem 11 09-04-2009 07:08 PM
Guess what? Ninja of Frozen Milk Total Mayhem 19 03-19-2009 07:33 AM
guess who ducklegion Total Mayhem 5 01-16-2009 04:05 PM
guess what! Yerfdog General Blabber 13 06-03-2008 09:26 AM


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2017, vBulletin Solutions Inc.
Site Map
Copyright 2017, Hamumu Games Inc.