2008 Canadian Computing Competition, Stage 1
Problem J1: Body Mass Index
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
BMI = ------------------ height × height
Write a program which takes in the patient's height and weight, calculates the BMI, and displays the corresponding message from the table below.
|More than 25||Overweight|
|Between 18.5 and 25.0 (inclusive)||Normal weight|
|Less than 18.5||Underweight|
Sample Input 1
Sample Output 1
The BMI is 69 / (1.73 × 1.73), which is approximately 23.0545. According to the table, this is a "Normal weight".
Sample Input 2
Sample Output 2
The BMI is 84.5 / (1.8 × 1.8), which is approximately 26.0802. According to the table, this is "Overweight".
Point Value: 3
Time Limit: 2.00s
Memory Limit: 16M
Added: Sep 28, 2008
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3