A Community health centre wants to use Body Mass Index (BMI) to find the ideal body preparation for the centre’s clients. You have recently hired to develop a Java application to calculate the BMI. In this application, the client has to enter first name, last name, weight, height and gender using keyboard. Your application must use the following equation to calculate the BMI:
BMI= W / H2
Where, W is the weight in kilograms and H is the height in meter. The BMI estimates whether the client is underweight, acceptable weight, overweight, obese, or morbidly obese according to the following table
Table 3: The BMI result
For example, if a male client weight is 80 Kg and height is 1.6 meter. The BMI is about 31.25 and the result is “Obese”.
Result
BMI (Female)
BMI (Male)
Underweight
Less than 19
Less than 20
Acceptable
Greater than or equal to 19 and less than 25
Greater than or equal to 20 and less than 25
Overweight
Greater than or equal to 25 and less than 30
Greater than or equal to 25 and less than 30
Obese
Greater than or equal to 30 and less than 40
Greater than or equal to 30 and less than 40
Morbidly Obese
Greater than or equal to 40
Greater than or equal to 40