In: Computer Science
USING MATLAB: Create a BMI calculator application that reads the
user’s weight in pounds and height in inches (or, if you prefer,
the user’s weight in kilograms and height in meters), then
calculates and displays the user’s body mass index. Also, the
application should display the following information from the
Department of Health and Human Services/National Institutes of
Health so the user can evaluate his/her BMI:
BMI VALUES
("Underweight : Less than 18.5
Normal : between 18.5 and 24.9
Overweight : between 25 and 29.9
Obese : 30 or greater
weight = input('Enter weight in pounds: ');
height = input('Enter height in inches: ');
BMI = weight*703/height^2;
fprintf('Calculated BMI: %g\n',BMI)
fprintf('Evaluation: ');
if BMI<18.5
fprintf('Underweight\n')
elseif BMI <=24.9
fprintf('Normal\n')
elseif BMI<=29.9
fprintf('Overweight\n')
else
fprintf('Obese\n')
end