Question: Create a java code with all the requirements: the program is about the Body Mass Index (BMI). It is measured in metric units: weight -

Create a java code with all the requirements:

the program is about the Body Mass Index (BMI). It is measured in metric units: weight - kilogram and height - meters. Once we apply the BMI formula (weight divided by the square of height) , the results:

BMI < 18.5 - Underweight

18.5 BMI < 25.0 - Normal

25.0 BMI < 30.o - Overweight

30.0 BMI - Obese

Users will input the weight in pounds and height in inches and we need to follow the conversions as:

1 pound - 0.4536 kilograms

1 inch - 0.0254 meters

The program needs to be done in two classes:

one class should be named BMI and should be with scanner operation and system.out.println statements

while the other class should have a return statement, public static double getBMI (double weight, double height) {

double result = 0.0;

and continue with the input parameters of this method.

One example OUTPUT:

Enter your name:

John

John, enter a non-negative floating-point number of your weight (in pounds):

223.5

John, enter a non-negative floating-point number of your weight (in inches):

68.77

John, your BMI is: 33.22653789251047

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!