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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started