Question: function BMI = ReportBMI ( userWeight , userHeight ) % userWeight: user weight in kg % userHeight: user height in centimeters kgToPounds = 2 .
function BMI ReportBMIuserWeight userHeight
userWeight: user weight in kg
userHeight: user height in centimeters
kgToPounds ; kg pounds
cmToInches ; cm in
Calls function with parameters weight kg and heigth cm
BMI CalculateBMIuserWeight userHeight;
Define a nested function CalculateBMI
Function inputs: userWeight kg userHeight cm
Function output: bmiValue
function bmiValue
Use kgToPounds and cmToInches conversion factor
bmiValue weight in lbs height in inches
end
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
