Created
January 21, 2012 02:39
-
-
Save nerdyworm/1650899 to your computer and use it in GitHub Desktop.
This file contains 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
// Mike Schmitt (Class #12109) | |
// Assignment #1 | |
// My First Program | |
#include <cstdlib> | |
#include <iostream> | |
using namespace std; | |
int dog_years(int years) | |
{ | |
return (years * 7); | |
} | |
int main() | |
{ | |
string name; | |
int age, dog_age; | |
cout << "Please enter your first name and press enter: "; | |
cin >> name; | |
cout << endl; | |
cout << "Please enter your age and press enter: "; | |
cin >> age; | |
cout << endl; | |
dog_age = dog_years(age); | |
cout << "Hello " << name << ". If you were a dog, you would be " << dog_age << " years old!" << endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment