Advertisement
lol1234561

Untitled

Feb 22nd, 2023
663
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.44 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class Main {
  3.     public static void main(String[] args) {
  4. Scanner keyboard = new Scanner(System.in);
  5.  
  6. double weight;
  7. int planet;
  8.  
  9.         System.out.println("Please enter your current earth weight in lbs: ");
  10.         weight = keyboard.nextDouble();
  11.  
  12.         System.out.println("I have information on the following planets: ");
  13.         System.out.println("1. Venus  2. Mars  3. Jupiter");
  14.         System.out.println("4. Saturn  5. Uranus  6. Neptune");
  15.         System.out.println();
  16.         System.out.println("Which planet are you visiting? ");
  17.         planet = keyboard.nextInt();
  18.  
  19.         if(planet == 1){
  20.             System.out.println("your weight would be " + (weight * 0.78) + " pounds on that planet");
  21.         } else if (planet == 2) {
  22.             System.out.println("your weight would be " + (weight * 0.38) + " pounds on that planet");
  23.         }else if (planet == 3) {
  24.             System.out.println("your weight would be " + (weight * 2.65) + " pounds on that planet");
  25.         }else if (planet == 4) {
  26.             System.out.println("your weight would be " + (weight * 1.17) + " pounds on that planet");
  27.         }else if (planet == 5) {
  28.             System.out.println("your weight would be " + (weight * 1.05) + " pounds on that planet");
  29.         }else if (planet == 6) {
  30.             System.out.println("your weight would be " + (weight * 1.23) + " pounds on that planet");
  31.         }
  32.  
  33.  
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement