package JAVA;
import java.util.Scanner;// Import all classes from the java.util scanner
public class Assignment1 {
public static void main(String[] args) {
// Create a Scanner to read user input
Scanner scanner = new Scanner(System.in);
// Prompt user to enter weight
System.out.print("Please enter your weight: ");
// Read the weight value input by the user
double weight = scanner.nextDouble();
// Check if the weight is less than 0 and print error message if true
if (weight < 0) {
System.out.println("Invalid weight");
}
// Check if the weight is less than 60 and print relevant message if true
else if (weight < 60) {
System.out.println("You are lightweight");
}
// Check if the weight is less than or equal to 80 and print relevant message if true
else if (weight <= 80) {
System.out.println("You are medium weight");
}
// If weight is greater than 80, print the heavyweight message
else {
System.out.println("You are heavyweight");
}
// Close the Scanner to release resources
scanner.close();
}
}