Created
October 8, 2012 05:28
-
-
Save itsjohncs/3850867 to your computer and use it in GitHub Desktop.
CS 10 SI Classroom Session 2 - Example 1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Twix | |
Fido | |
John | |
Smith | |
47 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Skittles | |
Hammy | |
Daniel | |
de Haas | |
20 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Starburst Starla Sarah Fredrickson 82 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() { | |
string faveCandy; | |
string firstPet; | |
string firstName; | |
string lastName; | |
int age; | |
cout << "Enter your favorite candy: "; | |
cin >> faveCandy; | |
cout << "Enter the name of your first pet: "; | |
cin >> firstPet; | |
cout << "Enter your first and last name: "; | |
cin >> firstName >> lastName; | |
cout << "Enter your age: "; | |
cin >> age; | |
cout << endl; | |
cout << "Your name is " << firstName << " " << lastName | |
<< " and your first pet's name was " << firstPet | |
<< " and your favorite candy is " << faveCandy << " and you are " | |
<< age << " years old." << endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I added comments demonstrating how to comment and explaining various parts of this code in my fork.