BMI Calculator

(This assignment was suggested by Joel H in 2012.)

The body mass index (BMI) is commonly used by health and nutrition professionals to estimate human body fat in populations.

It is computed by taking the individual's weight (mass) in kilograms and dividing it by the square of their height in meters.

Sample Output

Your height in m: 1.75
Your weight in kg: 73

Your BMI is 23.83673

Bonus #1 - Imperial Measurements

For +10 bonus points, input their weight and height using pounds and inches, and convert to kilograms and meters to figure the BMI.

Your height in inches: 69
Your weight in pounds: 160

Your BMI is 23.625289

For an extra +3 bonus points (+13 total), input their height in feet and inches.

Your height (feet only): 5
Your height (inches): 9
Your weight in pounds: 160

Your BMI is 23.625289

Bonus #2 - Categories

Do not add if statements to show the category for a given BMI. That's a different assignment.




©2013 Graham Mitchell

This assignment is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.
Creative Commons License