Question: For this lab, you must create variables, perform math operations on them, and then use those variables in print statements. You will create 5 variables
For this lab, you must create variables, perform math operations on them, and then use those variables in print statements.
You will create 5 variables at the top of your code. They must be named well, using proper naming techniques.
These 5 variables are for the following information:
- The name of a person
- The name of a dog
- The year the person was born
- The year the dog was born
- The current year
Assign a value to each of them.
The values of the dogs name and the humans name must be all lower case. For example, Professor Lewis, would be professor lewis.
Next you will use the variables for the years and calculate the age of the person and the dog by subtracting their birth years. (Assume that their birthdays are both January 1st, so you only have to worry about the years)
Assign the ages into two new variables.
Now create another variable that holds the value of the dogs age in dog years. For the purposes of this lab, dog years are simply the dogs age multiplied by 7.
So if your dog is 5 years old then it is 35 years old in dog years.
All of these calculations must be done using math operators and the variables. Do not manually figure out the answer and then just assign it to the variable.
Could you help me understand how one would break this down for python.
Finally, you will create print statement that uses the variables. It will also use string methods to capitalize the names correctly in the output.
Your output will look like this (with variable value replacing the blanks): ________ is __ years old. He has a dog named ________ who is __ years old. ________ is __ years old in dog years though.
Make sure to include the quotation marks around dog years.
An example output from the print would be: Josh is 50 years old. He has a dog named Sir Barksalot who is 5 years old. Sir Barksalot is 35 years old in dog years though.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
