Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dog_years1.cpp #57

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions 2-variables/dog-years/dog_years1.cpp
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
// Learn C++
// Dog Years

#include <iostream>
//mathwiz
int main() {

int main()
{
std::string dog_name;
int dog_age;

int dog_age = 3;
int human_age;

int early_years, later_years, human_years;
std::cout << "Enter your dogs name: ";
std::cin >> dog_name;

early_years = 21;
std::cout << "Enter your dogs age: ";
std::cin >> dog_age;

later_years = (dog_age - 2) * 4;
human_age = 21 + (dog_age*4);

human_years = early_years + later_years;
std::cout << "My name is " << dog_name << " I am " << dog_age << " In dog years I am " << human_age << " in human years\n" ;

std::cout << "My name is Sparkles! Ruff Ruff, I am " << human_years << " years old in human years.\n";


}