Search⌘ K
AI Features

Determine the BMI Category

Explore how to categorize BMI values using conditional logic in programming. Learn to apply if-else-if statements and draw flowcharts that map decisions, helping you understand decision-making in programs and solve real problems effectively.

Problem statement

Suppose you have the body mass index (BMI) of a person, and you want to find out if the person is underweight, healthy, overweight, or obese based on the following:

  • obese: BMI is greater than or equal to 30
  • overweight: BMI is greater than or equal to 25 but less than 30
  • healthy: BMI is greater than or equal to 18.5 but less than 25
  • underweight: BMI is less than 18.5

The main steps in problem-solving

Understand the problem

Go over the problem statement carefully and think about the desired output. The output should be one of the four ...