Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C language 3.22 Training heart rate The following are the formulas for training heart rate: THR = (MHR-RHR) X INTEN + RHR THR: training heart
C language
3.22 Training heart rate The following are the formulas for training heart rate: THR = (MHR-RHR) X INTEN + RHR THR: training heart rate MHR: maximum heart rate o Males: MHR = 203.7/(1 + e^(0.033* (age-104.3))) o Females: MHR = 190.2/(1 + e^(0.0453* (age-107.5))) INTEN: fitness level o 0.55 for low intensity o 0.65 for medium intensity o 0.80 for high intensity RHR: resting heart rate Write a program that prompts the user for their sex (as a character: m/f), age (as an integer), resting heart rate (as an integer), and fitness level (as a string: low, medium, or high). Given the information, use branching to calculate their training heart rate. Below is an example of the required input/output where XXX indicates your final calculation rounded to the nearest whole number: Sex (m/f): Age: Intensity level (low, medium, high): Resting heart rate: Training heart rate: XXX BPM Hint: Use a switch statement on the sex (m/f) to calculate the user's MHR. Use if-else statements and strcmp in string.h to select the appropriate value of INTEN. Hint: To round your final THR to the nearest whole number use the round function in math.hStep 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