HW2.14-LMLPHP

 import java.util.Scanner;

 public class Solution
 {
     public static void main(String[] args)
     {
         final double POUND_TO_KILOGRAM = 0.45359237;
         final double INCH_TO_METER = 0.0254;

         Scanner input = new Scanner(System.in);

         System.out.print("Enter weight in pounds: ");
         double weightInPounds = input.nextDouble();

         System.out.print("Enter height in inches: ");
         double heightInInches = input.nextDouble();

         input.close();

         double weightInKilogram = weightInPounds * POUND_TO_KILOGRAM;
         double heightInMeter = heightInInches * INCH_TO_METER;

         double BMI = weightInKilogram / (heightInMeter * heightInMeter);
         System.out.println("BMI is " + BMI);
     }
 }
05-11 19:31