divider

Objective

Create a program that calculates the Body Mass Index (BMI) given a user's weight in pounds and height in inches.

Note: BMI is not always a great indicator for health metrics, but it makes for a good code challenge.

Skills to Practice

  • icon Branching with selection statements
divider

Tasks

  • icon Create a new project named application-2-3
  • icon Complete the following tasks:
    • icon Calculate the user's BMI using the formula BMI = (weight / height2) × 703
    • icon The program should output the BMI along with the corresponding category:
      • icon Underweight: BMI < 18.5
      • icon Normal weight: 18.5 <= BMI < 24.9
      • icon Overweight: 25 <= BMI < 29.9
      • icon Obesity: BMI >= 30
divider

Sample Output

Sample Output
Enter your weight in pounds:180 [Enter]
Enter your height in inches:70 [Enter]
Your BMI is 25.82, which is considered Overweight.

Begin Challenge