Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

  1. asks the user to enter his/her

    1. gender, M (for male) or F (for female),

    2. age (number),

    3. resting heart rate (number), and

    4. fitness level (low, medium, or high).

  2. uses if-elseif structure to assign values to MHR based on the gender.

  3. 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:

  1. A 19-year-old male, resting heart rate of 63, and medium fitness level.

  2. A 20-year-old female, resting heart rate of 64, and high fitness level.

  3. 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.

  4. 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional IPhone And IPad Database Application Programming

Authors: Patrick Alessi

1st Edition

0470636173, 978-0470636176

More Books

Students also viewed these Databases questions