Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Python Programming: Create a Python program that takes a users age and resting heart rate, and computes the range of heart rates that correspond to
Python Programming:
Create a Python program that takes a users age and resting heart rate, and computes the range of heart rates that correspond to each of the zones below:
- Zone 1 (50-60%): This zone should feel super easy -- almost like you didn't work out at all.
- Zone 2 (60-70%): This is the "average effort" level where it is still possible to hold a conversation.
- Zone 3 (70-82%): This is the "above average effort" level where you can only talk in one- or two- word answers.
- Zone 4 (82-92%): This is the "hard effort" level. Your breathing is labored, your arms and legs feel heavy, and you can't sustain the pace for much more than an hour (at best).
- Zone 5 (92-100%): This is the "all out" level. You can sustain this pace for a few seconds to maybe five minutes.
Necessary Formulas:
- max_heart_rate = 208 - (0.7 * age)
- resting heart rate is your heart rate when you have been resting - i.e., sitting or lying for at least 20 minutes (user inputs this part)
- heart_reserve_rate = max heart rate resting heart rate
- heart_rate_by _Percentage_Zone = resting heart rate + (heart reserve rate * desired percentage zone)
Important notes:
The lower bound of a zone is 0.01 greater than before it. (E.g. Zone 1 upper bound is 137.90, Zone 2 lower bound is 137.91)
Sample Output:
Please enter your age: 25 Please enter your resting heart rate: 59, ========================================= Your heart rate reserve is: 131.5 Here is a breakdown of your training zones: Zone 1: 124.75 to 137.90 Zone 2: 137.91 to 151.05 Zone 3: 151.06 to 166.83 Zone 4: 166.84 to 179.98 Zone 5: 179.99 to 190.50Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started