SpaceBoxing
Code
import java.util.Scanner;
public class SpaceBoxing
{
public static void main( String[] args )
{
int weight, planet;
Scanner keyboard = new Scanner(System.in);
System.out.print( " How much do you weigh? " );
weight = keyboard.nextInt();
System.out.println( " Choose your planet " );
System.out.println( "1. Venus 2. Mars 3. Jupiter ");
System.out.println( "4. Saturn 5. Uranus 6. Neptune ");
System.out.print( " ");
System.out.println( " Which planet do you want to vist? ");
planet = keyboard.nextInt();
if ( planet == 1 )
{
System.out.println( "your weight would be " + (weight*.78));
}
else if ( planet == 2)
{
System.out.println( " your weight would be " + (weight*.39));
}
else if ( planet == 3)
{
System.out.println( " your weight would be " + (weight*2.65));
}
else if ( planet == 4)
{
System.out.println( "your weight would be " + (weight*1.17));
}
else if ( planet == 5)
{
System.out.println( "your weight would be " + (weight*1.05));
}
else if ( planet == 6)
{
System.out.println( "your weight would be " + (weight*1.23));
}
}
}
SpaceBoxing