double w,h,BMI; int i; Scanner sc = new Scanner(System.in); for (i = 0;i<3;i++) { System.out.print("\nWeight = "); w = sc.nextDouble(); System.out.print("Height = "); h = sc.nextDouble(); BMI = w/(h*h); System.out.printf("BMI = %f\n",BMI); if(BMI<18.5) System.out.println("Underweight"); else if(BMI<25) System.out.println("Normal"); else if(BMI<30) System.out.println("Overweight"); else System.out.println("Obese"); }