Question: target heartrate zone when exercising is: 2 0 years old is 1 0 0 to 1 7 0 beats per minute 3 0 years old

target heartrate zone when exercising is:
20 years old is 100 to 170 beats per minute
30 years old is 95 to 162 beats per minute
35 years old is 93 to 157 beats per minute
40 years old is 90 to 153 beats per minute
45 years old is 88 to 149 beats per minute
50 years old is 85 to 145 beats per minute
55 years old is 83 to 140 beats per minute
60 years old is 80 to 136 beats per minute
65 years old is 78 to 132 beats per minute
70 years old is 75 to 128 beats per minute
We will use the age as a minimum. So the first block will be 20 to 29 years old.
Use heart.py. It included main() and imports the Person class.
main() will prompt the user for a name and an age
Set those values
Print the information about the person and the target heart rate
You must write the Person class in person.py
You must use heart.py that is provided in the Test zip file
The Person class should have:
A constructor that can have name and age passed in. The name should default to and the age should default to 21
A __str__ function that formats as the name, a space, (, the age, a space, years old)
Make getter/setter properties as needed
Because of the way we have the age ranges, we will not allow any person to be younger than 20 years old. Raise a ValueError, with the message invalid age, if there is an attempt to set the age to less than 20. Then let main() print that message
A get_target_rate function that has no parameters and returns a tuple with the min and max target heart rate
Sample Run #1(bold, underlined text is what the user types):
Name? Sue
Age? 25
Sue (25 years old)
Sue should aim for 100 to 170 bpm
Test #1 checks all output
Mini Test #2 output includes Sue (25 years old) and Sue should aim for 100 to 170 bpm on consecutive lines
Note: This is an introductory level python class and programming should reflect this. This problem covers classes and is composed of two different python scripts: heart.py (already written and is just called upon in person.py) and person.py (this is what is actually being coded). There is a sample test of what the output should look like when the program is runned.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!