Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Main Memory Database Systems

Authors: Frans Faerber, Alfons Kemper, Per-Åke Alfons

1st Edition

1680833243, 978-1680833249

More Books

Students also viewed these Databases questions

Question

7. What decisions would you make as the city manager?

Answered: 1 week ago

Question

8. How would you explain your decisions to the city council?

Answered: 1 week ago