Answer to Question #267378 in Java | JSP | JSF for Nicole

Question #267378

According to the National Heart, Lung, and Blood Institute of the National Institutes of Health, body mass index (BMI) is a measure of body fat based on height and weight that applies to adult men and women. It is used to monitor one's health by determining whether one is underweight, overweight, has normal weight or is obese. It is computed based as follows (when using standard weight in pounds and height in inches):





BMI = 703 x (weight/(height2))





Note: For this problem, you need to format the output to print the appropriate number of decimal places. You need to use System.out.format (Read: https://docs.oracle.com/javase/tutorial/java/data/numberformat.html)

1
Expert's answer
2021-11-17T12:03:18-0500
public class Sol {
  public static void main(String[] args) {
    Scanner s = new Scanner(System.in);
    System.out.println("Enter your mass and height");
    double mass = s.nextDouble();
    double height = s.nextDouble();
    System.out.printf("Your BMI equals to %.10f", 703 * (mass / height));
  }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS