CSCI-101: Intro to Computer Science
Python Course

BMI Calculator

The Body-Mass Index of a person is a value derived from their weight and height. More specifically, it may be computed using the formula:

$$\frac{m}{h^2}$$

where \(m\) is the mass in kilograms, and \(h\) is the height in meters of the person.

Your Program

Write a program which:

  1. Asks the user for their weight in pounds. Store this as a variable, and make sure to convert to an integer. You may assume that the user will only enter a positive, whole-valued number of pounds.
  2. Asks the user for their height in inches. You will want to store this as another variable. Again, you way assume that the user will only enter a positive, whole-valued number of inches.
  3. Converts their weight from pounds to kilograms by multiplying by \(0.454\).
  4. Converts their height from inches to meters by multiplying by \(0.0254\).
  5. Calculates the user's BMI.
  6. Prints the BMI calculation to the console.

When you are done, try calculating a BMI and compare to an online calculator. Was the BMI calculated correctly? Ask for help if you need!