Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Change the original Health Application: Computing BMI problem in Assignment 3 as

ID: 3759603 • Letter: C

Question

Change the original Health Application: Computing BMI problem in Assignment 3 as follows: Prompt the user to enter a weight in pounds and height in inches

These two arguments will need to be passed to the calcBMI() method

Create a double return type method, to calculate the BMI by taking the weight in kilograms and dividing by the square of the height in meters. Call the method calcBMI(parameter, parameter) to receive weight and height

Declare the following constants for the conversion formula to be used in calcBMI method (see page 43):

final double POUNDTOKILO = .45359237

final double INCHTOMETER = 0.0254

Create a void method that displays the BMI, displayBMI(..…). The calculated BMI will be passed to this method so the method will need to have one parameter which is of the double type with a void return.

Add Java comments to the above class – author, version, methods by typing /** click enter above the methods, and the Eclipse environment with add the @params

Explanation / Answer

public static void main(String[] args)
{
Scanner s = new Scanner(System.in);
double weight, height, bmi;
final double POUND = 0.3645888
final double INCH = 0.098445
System.out.print("Enter weight in pounds:");
weight = s.nextDouble();
System.out.print("Enter height in inches:");
height = s.nextDouble();
weight = weight * POUND; // it converts weight from pounds to kilograms
height = height * INCH; // it coverts height from inches to meters
bmi = weight/(Math.pow(height, 2));
System.out.print("BMI is " + bmi);
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote