Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Mass and Weight
- // Kaleb Speas
- import java.util.Scanner;
- public class MassAndWeight
- {
- public static void main(String[] args)
- {
- Scanner keyboard = new Scanner(System.in);
- System.out.println("Please enter objects mass in grams.");
- double mass = keyboard.nextDouble();
- double weight = mass * 9.8;
- if (mass > 1000)
- System.out.println("Your object is too heavy!");
- else if (mass < 10)
- System.out.println("Your object is too light");
- else
- System.out.println("Your object weighs " + weight
- + " Newtons.");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement