Question: C# help Assignment Requirements In this application we are calculating two different values: the first is the Body Mass Index (BMI) and the second is

C# help

Assignment Requirements

In this application we are calculating two different values: the first is the Body Mass Index (BMI) and the second is a series of maximum heart rate values at specific exercise intensity percentages calculated using the Karvonen formula.

BMI

BMI is a calculation of body fat based on an individual's height and weight.

To calculate BMI you need two different values: height in inches and weight in pounds. Once you have obtained these values you will then need to convert the height from inches to height in meters squared, and the weight in pounds to the weight in kilograms. I am not going to provide these conversion formulas to you; you have to do a little online research to find them. In the case of converting inches to meters squared you need to convert inches to meters and then square that value.

The formula for calculating BMI is as follows:

where:

  • weight is value in kilograms
  • height is value in meters squared

The value for bmi will be a decimal from zero (dead) to a high number indicating high body fatness. Based on the BMI value a person is categorized according to their body fat as follows:

  • Underweight = <18.5
  • Normal weight = 18.524.9
  • Overweight = 2529.9
  • Obesity = BMI of 30 or greater

In addition to calculating the user's BMI you will determine which of the above categories the user falls into based on their BMI.

There are many online calculators that you can use to check your BMI results, one such can be found at the National Institute of Health. (Link to website here.)

Karvonen Formula

The Karvonen formula is used to calculate a target heart rate at specific workout intensities. It can be used to calculate ideal heart rate ranges for specific kinds of workout intensities. What I wish to do is to calculate what the maximum heart rate will be based on exercise intensity that begins at 50% and increases by 5% to a maximum intensity of 95%. This, of course, implies using a loop. We want to construct a loop that will iterate this calculation for the maximum heart rate for each of our exercise intensity percentages.

To calculate maximum heart rate according to the Karvonen formula you need two different values: age and resting heart rate.

The formula for calculating the maximum heart rate is as follows:

where:

  1. mhr is maximum heart rate calculated as 220 minus your age
  2. hrr is heart rate reserve calculated by taking maximum heart rate (from step 1) minus resting heart rate
  3. mtz is maximum target zone calculating by taking heart rate reserve (from step 2) multiplied by intensity percent
  4. ttz is target training zone calculated by taking mtz (from step 3) and adding resting heart rate

example:

Suppose you have a resting heart rate of 70 beats per minute and your age is 35, and let's suppose we want to know what the maximum heart rate should be at 60% intensity workout:

220 - 35 = 185 (this results in the maximum heart rate -- mhr) 185 (mhr) - 70 = 115 (this results in the heart rate reserve -- hrr) 115 (hrr) * .60 = 69 (this results in the maximum target zone -- mtz) 69 (mtz) + 70 = 139 (this is the result that will be output for 60% exercise intensity)

Therefore, 139 is the maximum heart rate for someone who is 35 years of age, has a resting heart rate of 70, and is exercising at a 60% intensity level.

We want to perform this calculation for each exercise intensity level from 50% to 95%, with each level incremented by 5%

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 Databases Questions!