Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The body mass index, or BMI, is a calculation used to determine your level of body fat. BMI is a simple calculation using a
The body mass index, or BMI, is a calculation used to determine your level of body fat. BMI is a simple calculation using a person's height and weight. In some cases, it can help a doctor determine your overall fitness and your risk of developing chronic diseases. The formula to calculate BMI is: BMI [weight] [height] = [Kg] [m] 1. Write a function, fn_weight which convert weight unit from pound, lbs to kg 1 [lbs]=0.454[kg] 2. Write a function, fn_height which convers height unit from inch to meter, m 1 [inch] = 0.0254[m] 3. Write a function, fn_BMI which calculates BMI with input values of unit [kg] and [m] 4. Write a script called BMI that shows the table of BMI from height range of 50-80 inch in every 2 inch and weight range of 80 - 220 lbs in every 10 lbs. Make height in a column and weight in a row table, by using either for or while loop. Use 3 functions that are defined in prob.#1-3. Script BMI also prompts the user to input height and weight in inch and pound, respectively and print out its BMI. Generally, if you're at a healthy weight, the BMI should fall between 18.5 and 24.9. Display "Healthy!" message if the calculated BMI is in that healthy range. Output display in table style should be like: Command Window BMI weight [lbs] 80.0 90.0 100.0 110.0 120.0 130.0 140.0 height [inch] 50.0 22.5 25.3 28.1 31.0 33.81 36.6 39.4 52.0 20.8 23.4 26.0 28.6 31.2 33.8 36.4 54.0 19.3 21.7 24.1 26.5 29.0 31.4 33.8 56.0 18.0 28.2 22.4 24.7 26.9 29.2 31.4 58.0 16.7 18.8 20.9 23.0 25.1 27.2 29.3 60.0 15.6 17.6 19.5 21.5 23.5 25.4 27.4 62.0 14.6 16.5 18.3 20.1 22.0 23.8 25.6 64.0 13.7 15.5 17.2 18.9 28.6 22.3 24.1 66.0 12.9 14.5 16.2 17.8 19.4 21.0 22.6 68.0 12.2 13.7 15.2 16.7 18.3 19.8 21.3 70.0 11.5 12.9 14.4 15.8 17.2 18.7 20.1 5. Run BMI.m with the average American man over age 20 of weight = 195.7 lbs and height = 69.2 inch. . *Hint* This is not a good code to display the table as required. Try to modify. %create BMI table %weight range: 80-220 lbs % height range: 50-80 inch W=80; H=50; fprintf("%10s %10s %s ', 'BMI, 'weight', 'height') while W
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