-
-
Save codecademydev/e818f94c86c8c929d4de46010bf3cfec to your computer and use it in GitHub Desktop.
Codecademy export
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
#include <iostream> | |
int main() { | |
//dog age entered | |
int dog_age; | |
//First two years of a dog's life is 21 human years. | |
int early_years = 21; | |
//Each following year counts as 4 human years. Minus the first two years for the 21 years. | |
int later_years = (dog_age-2) * 4; | |
int human_years = early_years + later_years; | |
std::cout << "Enter your dog's age: \n"; | |
std::cin >> dog_age; | |
std::cout << "My name is Luna! Ruff ruff, I am " << human_years << " years old in human years.\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment