Question
PLEASE HELP!! SOLVE THIS CODE USING MATLAB! Thank you The following are formulas for calculating the Training Heart Rate (THR): = ( ) + where
PLEASE HELP!! SOLVE THIS CODE USING MATLAB! Thank you
The following are formulas for calculating the Training Heart Rate (THR): = ( ) +
where MHR is the maximum heart rate given by (https://en.wikipedia.org/wiki/Heart_rate): For male: = 203.7 , for female: = 190.2
RHR is the resting heart rate, and INTEN is the fitness level (0.55 for low, 0.65 for medium, and 0.8 for high fitness).
(13 pts) Write a program in a script file HW5P2 to determine the required THR, that
-
asks the user to enter his/her
-
gender, M (for male) or F (for female),
-
age (number),
-
resting heart rate (number), and
-
fitness level (low, medium, or high).
-
-
uses if-elseif structure to assign values to MHR based on the gender.
-
uses switch-case structure to assign values to INTEN based on the fitness level.
iv.
v.
If the program did not recognize the gender or fitness level entered, the program must throughamessage'Invalid entry, check your input and try again.' using the error() function in MATLAB and stop. Check the help of theerror function in MATLAB to know how it works.
For the case of no errors, the program determines and displays the training heart rate (rounded to the nearest integer), as
For a XX year-old FMFM with XX resting heart rate and HML fitness level, the training heart rate is XX
1+0.033(104.3) 1+0.0453(107.5)
XX is for numbers, FMFM is for (male or female) and HML is for (high, medium or low). (2 pts) Use the program for determining the training heart rate for the following two
individuals:
-
A 19-year-old male, resting heart rate of 63, and medium fitness level.
-
A 20-year-old female, resting heart rate of 64, and high fitness level.
-
A 45-year-old female, resting heart rate of 59, and medium fitness level. Enter females K not F. The program must through an error for this case.
-
A 45-year-old male, resting heart rate of 59, and med fitness level. Enter medium asmed, abbreviated. The program must through an error for this case.
Step 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