Design a program that asks the user to enter an objects mass, and then calculates its weight. if the object weighs more than 1,000 newtons, display a message indicating that it is too heavy. if the object weighs less than 10 newtons, display a message indicating that it is too light.

Respuesta :

import java.util.Scanner;public class WeightMeasure { public static void main(String[] args){ Scanner input = new Scanner(System.in);
System.out.print("Enter weight of object in newtons: "); double weight = input.nextDouble(); if (weight > 1000) { System.out.println("Object is too heavy"); }else if (weight < 10) { System.out.println("Object is too light"); } }}