Skip to content

Instantly share code, notes, and snippets.

@nerdyworm
Created January 21, 2012 02:39
Show Gist options
  • Save nerdyworm/1650899 to your computer and use it in GitHub Desktop.
Save nerdyworm/1650899 to your computer and use it in GitHub Desktop.
// 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