Answer:
public class WeightCalculator {
private static DecimalFormat df2 = new DecimalFormat("#.##");
public static void main(String args[]){
//create scanner to receive user input
Scanner in = new Scanner(System.in);
//alert user to input mass
System.out. println("Enter the Mass in Kg");
//collect the input as a string
String s = in. nextLine();
//convert string to double and multiply by 9.8
Double weight = Double.valueOf(s)* 9.8;
//Print out answer formatted to 2 decimal place
System.out. println("The Weight is " + df2.format(weight) + "N");
//conditional statement to check if weight is less than 100
if (weight < 100){
System.out. println("Oops, it is too light");
}
//conditional statement to check if weight is more than 500
if (weight > 500){
System.out. println("Oops, it is too heavy");
}
}
}