Answer:
import java.util.Scanner;
public class MyProgram {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
// Prompt the user to enter their weight in kilograms.
System.out.println("Enter your weight in kilograms: ");
double weight = input.nextDouble();
// Prompt the user to enter their height in meters.
System.out.println("Enter your height in meters: ");
double height = input.nextDouble();
// Calculate the BMI.
double bmi = (weight * 703) / (height * height);
// Print the BMI.
System.out.println("Your BMI is " + bmi);
// Classify the BMI.
if (bmi < 18.5) {
System.out.println("You are underweight.");
} else if (bmi < 25) {
System.out.println("You have a normal weight.");
} else if (bmi < 30) {
System.out.println("You are overweight.");
} else if (bmi < 35) {
System.out.println("You are obese.");
} else {
System.out.println("You are severely obese.");
}
}
}