BMI

PHOTO EMBED

Thu Nov 21 2024 03:19:18 GMT+0000 (Coordinated Universal Time)

Saved by @Saging #java

package bodymassindex;

import java.util.*;

public class BodyMassIndex {
    //metric
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        System.out.print("Enter your Weight in pounds: ");
        double weight = sc.nextDouble();
        System.out.print( "Enter your Height in inch: ");
        double height = sc.nextDouble();    
        
        double BMI = 703 * (weight/Math.pow(height,2));
        
        System.out.println("Weight: " + weight);
        System.out.println("Height: " + height);
        System.out.println("BMI: " + Math.round(BMI));
    }
}
content_copyCOPY