package nameyu;import java.util.Scanner;public class Test { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Scanner input=new Scanner(System.in); System.out.print("Enter weight in pounds:"); double weight=input.nextDouble(); System.out.print("Enter height in inches:"); double height=input.nextDouble(); double rice=height*0.0254; double kg=weight*0.45359237; double BMI=kg/(rice*rice); System.out.println("BMI is"+BMI); } }
|