Ask Question
1 October, 13:30

2-3 Calculating the Body Mass Index (BMI). (Programming Exercise 2.14) Body Mass Index is a measure of health based on your weight. It can be calculated by taking your weight in kilograms and dividing by the square of your height in meters. Write a program that prompts the user to enter a weight in pounds and height in inches and displays the BMI. Note: One pound is 0.45359237 kilograms and one inch is 0.0254 meters. Hint: Convert the pounds entered into kilograms also convert the height in inches into meters Example: If you entered in pounds your weight as 95.5 and your height as 50 inches then the calculated BMI is 26.8573 FYI: BMI

+5
Answers (1)
  1. 1 October, 14:39
    0
    weight = float (input ("Enter your weight in pounds: "))

    height = float (input ("Enter your height in inches: "))

    weight = weight * 0.45359237

    height = height * 0.0254

    bmi = weight / (height * height)

    print ("Your BMI is: %.4f" % bmi)

    Explanation:

    *The code is written in Python.

    Ask the user to enter weight in pounds and height in inches

    Convert the weight into kilograms and height into meters using given conversion rates

    Calculate the BMI using given formula

    Print the BMI
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “2-3 Calculating the Body Mass Index (BMI). (Programming Exercise 2.14) Body Mass Index is a measure of health based on your weight. It can ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers