Advertisement
CamiloCastilla

Untitled

Sep 16th, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.53 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class Main {
  3.  
  4.     public static void main(String[] args) {
  5.  
  6.         Scanner keyboard = new Scanner(System.in);
  7.  
  8.  
  9.         int weight;
  10.         System.out.println("Please enter your current earth weight: ");
  11.         weight = keyboard.nextInt();
  12.  
  13.         System.out.println("I have information for the following planets");
  14.         System.out.println("1. Venus   2. Mars   3. Jupiter");
  15.         System.out.println("4. Saturn   5. Uranus   6.Neptune");
  16.         System.out.println("Which planet are you visiting?");
  17.  
  18.         double choice= keyboard.nextInt();
  19.         if (choice==1) {
  20.             double venus=(weight*0.78);
  21.             System.out.println("Your weight on Venus would be " + venus + "kg");
  22.         } else if (choice==2) {
  23.             double mars=(weight*0.39);
  24.             System.out.println("Your weight on Mars would be " + mars + "kg");
  25.         } else if (choice==3) {
  26.             double jupiter=(weight*2.65);
  27.             System.out.println("Your weight on Jupiter would be " + jupiter + "kg");
  28.         } else if (choice==4){
  29.             double saturn=(weight*1.17);
  30.             System.out.println("Your weight on Saturn would be " + saturn + "kg");
  31.         }else if (choice==5){
  32.             double uranus=(weight*1.05);
  33.             System.out.println("Your weight on Uranus would be " + uranus + "kg");
  34.         } else {
  35.             double neptune=(weight*1.23);
  36.             System.out.println("Your weight on Neptune would be " + neptune + "kg");
  37.         }
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement