Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner keyboard = new Scanner(System.in);
- int weight;
- System.out.println("Please enter your current earth weight: ");
- weight = keyboard.nextInt();
- System.out.println("I have information for the following planets");
- System.out.println("1. Venus 2. Mars 3. Jupiter");
- System.out.println("4. Saturn 5. Uranus 6.Neptune");
- System.out.println("Which planet are you visiting?");
- double choice= keyboard.nextInt();
- if (choice==1) {
- double venus=(weight*0.78);
- System.out.println("Your weight on Venus would be " + venus + "kg");
- } else if (choice==2) {
- double mars=(weight*0.39);
- System.out.println("Your weight on Mars would be " + mars + "kg");
- } else if (choice==3) {
- double jupiter=(weight*2.65);
- System.out.println("Your weight on Jupiter would be " + jupiter + "kg");
- } else if (choice==4){
- double saturn=(weight*1.17);
- System.out.println("Your weight on Saturn would be " + saturn + "kg");
- }else if (choice==5){
- double uranus=(weight*1.05);
- System.out.println("Your weight on Uranus would be " + uranus + "kg");
- } else {
- double neptune=(weight*1.23);
- System.out.println("Your weight on Neptune would be " + neptune + "kg");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement