A quantity known as the body mass index (BMI) is used to calculate the risk of weight-related health problems. BMI is computed by the formula

BMI = w/(h/100)^2

Where w is weight in kilograms and h is height in centimeters. A BMI of about 20 to 25 is considered “normal.” Write an application that accepts weight and height (both integers) and outputs the BMI. Use standard Java input/output (System.in with Scanner class and System.out).

The user’s weight and height must be read in and stored as integers. Calculate the BMI (a floating-point number) and display the result. In the calculation, the height is divided by 100 to convert from centimeters to meters. You must define a constant to represent this conversion value (100.0).

Please help me.

Edited by jcooler: n/a

7 Years
Discussion Span
Last Post by chiiqui

Please check the Member Rules for DaniWeb

"Do provide evidence of having done some work yourself if posting questions from school or work assignments"


I made this type of program once, this is easy, but providing/ exerting effort will do help you a lot . please exert some more effort in posting

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.