Develop a user-dened function entitled calulateBMI which computes the BMI given
ID: 3564580 • Letter: D
Question
Develop a user-dened function entitled calulateBMI which computes the BMI given the weight and height of an individual. Execute your user-dened function with weight and height input arguments. When developing your function, start with the following framework and articulate the output as shown in the example.
Develop a user-defined function entitled calculateBMI which computes the BMI given the weight and height of an individual. Execute your user-defined function with weight and height input arguments. When developing your function, start with the following framework and articulate the output as shown in the example. Execute your user-defined function with the following input parameters (you'll have to translate feet to inches): (a) An individual weighting 180 lbs whose height is 5ft. 4inches. (b) An individual weighting 155 lbs whose height is 5ft. 6inches. (c) You.Explanation / Answer
function [bmi]= calulateBMI(weight, height)
bmi=703*weight/height^2;
if (bmi<18.5)
display('Your BMI value is ')
display(bmi)
display('which classifies you as Underweight');
elseif (bmi<25)
display('Your BMI value is ')
display(bmi)
display('which classifies you as Normal');
elseif (bmi<30)
display('Your BMI value is ')
display(bmi)
display('which classifies you as Overweight');
else
display('Your BMI value is ')
display(bmi)
display('which classifies you as Obese');
end
end
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.