## CCC '08 J1 - Body Mass Index

View as PDF

Points: 3
Time limit: 2.0s
Memory limit: 64M

Problem type

The Body Mass Index (BMI) is one of the calculations used by doctors to assess an adult's health. The doctor measures the patient's height (in metres) and weight (in kilograms), then calculates the BMI using the formula:

Write a program which takes the patient's weight and height as input, calculates the BMI, and displays the corresponding message from the table below.

BMI Category Message
More than Overweight
Between and (inclusive) Normal weight
Less than Underweight

#### Sample Input 1

69
1.73

#### Output for Sample Input 1

Normal weight

#### Explanation for Output in Sample Input 1

The BMI is which is approximately . According to the table, this is a "Normal weight".

#### Sample Input 2

84.5
1.8

#### Output for Sample Input 2

Overweight

#### Explanation for Output in Sample Input 2

The BMI is , which is approximately . According to the table, this is "Overweight".

• ericzhou9  commented on Feb. 9, 2019, 10:46 a.m.

me too it always say INput mismatch

• retronerd2016  commented on Oct. 28, 2017, 8:31 p.m.

how do you make it so that it doesn't tell you INput misMatch all the time, I try to insert a decimal in the console and it can't show up.

• Mr_Lim  commented on Oct. 24, 2017, 12:24 p.m.

"Write a program which prompts for the patient's height and weight" should be changed. No prompting should be done, and the input order is weight first, then height.

• Phoenix1369  commented on Oct. 26, 2017, 4:20 p.m.

Fixed, thanks!

• mozart  commented on Oct. 1, 2017, 9:53 a.m.

This comment is hidden due to too much negative feedback. Click here to view it.