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);
- double weight;
- int planet;
- System.out.println("Please enter your current earth weight in lbs: ");
- weight = keyboard.nextDouble();
- System.out.println("I have information on the following planets: ");
- System.out.println("1. Venus 2. Mars 3. Jupiter");
- System.out.println("4. Saturn 5. Uranus 6. Neptune");
- System.out.println();
- System.out.println("Which planet are you visiting? ");
- planet = keyboard.nextInt();
- if(planet == 1){
- System.out.println("your weight would be " + (weight * 0.78) + " pounds on that planet");
- } else if (planet == 2) {
- System.out.println("your weight would be " + (weight * 0.38) + " pounds on that planet");
- }else if (planet == 3) {
- System.out.println("your weight would be " + (weight * 2.65) + " pounds on that planet");
- }else if (planet == 4) {
- System.out.println("your weight would be " + (weight * 1.17) + " pounds on that planet");
- }else if (planet == 5) {
- System.out.println("your weight would be " + (weight * 1.05) + " pounds on that planet");
- }else if (planet == 6) {
- System.out.println("your weight would be " + (weight * 1.23) + " pounds on that planet");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement