Step-by-step explanation:
First, user is asked to input height in inches and weight in pounds.
Secondly, conversion of pounds into kgs is done using the ratios given in the problem.
Thirdly, BMI is calculated using the formula weight in kg's divided by height in meters squared then rounding to the first decimal point and displaying.
Lastly, cases of under-weight, normal weight and over-weight are determined according to the BMI.
Python Code:
h=int(input("Please enter your height in inches: "))
w=int(input("Please enter your weight in pounds: "))
height = h*2.54/100
weight = w*453.59/1000
BMI = weight/(height*height)
print("your BMI is: ", round(BMI,1))
if BMI <= 18.5:
print("You are under-weight! eat more")
elif BMI >18.5 and BMI <= 24.9:
print("You are normal-weight!")
else:
print("You are over-weight! eat less")
Output:
Please enter your height in inches: 68
Please enter your weight in pounds: 150
your BMI is: 22.8
You are normal-weight!
Please enter your height in inches: 70
Please enter your weight in pounds: 250
your BMI is: 35.9
You are over-weight! eat less