#include using namespace std; //Often comments at the top //are there to describe what //the program does. //This program is just to demo //some basic c++ stuff. int main() { //These are comments. //they are ignored by the compiler //In this line we greet the user cout << "What's popping world!"; cout << "Don't see no spaces...."; //Hola mi perro cout << " (like I care anyway...)"; cout << "Yo quiero stuff" << endl; //comments don't even need to make sense: //baljglsdjgdlhgalsjgdlj cout << endl; //Now, let's talk about some variables //Declare a variable for storing an integer //You can call it whatever you want. //We chose to call it myVariable int myVariable; //We can set the value of the variable //using the assignment operator, = myVariable = 17; //We can look at the variable and output it's value cout << "The variable has value "; cout << myVariable; cout << endl; cout << endl; //Write code to ask user their age, //Then reply to them mentioning their age //as if its impressive //Step 0: Declare a variable for later use int age; //Step 1: Ask user how old they are cout << "How old are you, dude?" << endl; //Step 2: Get user's response, store in variable cin >> age; //Step 3: Comment on person's age. cout << "OMG, you are "; cout << age; cout << " year old!?!?!? How are you still alive?!?" << endl; //Step 4: Let's get fancy (extra bonus thing, ignore if //too complicated). // >= checks for "greater than OR equal to" if (age >= 40) { cout << "you're over 40! You're life is over.." << endl; } if (age < 20) { cout << "you're a zoomer!" << endl; } return 0; }