Assignment #38 and SpaceBoxing
Code
/// Name: Jason Kim
/// Period: 7
/// Program Name: SpaceBoxing
/// File Name: SpaceBoxing.java
/// Date Finished:10/6/15
import java.util.Scanner;
public class SpaceBoxing
{
public static void main (String [] args)
{
Scanner keyboard = new Scanner(System.in);
int weight, planetNumb;
System.out.print("Please enter your current earth weight: ");
weight = keyboard.nextInt();
System.out.println();
System.out.println("I have information for the following planets:");
System.out.println("\t1. Venus\t2. Mars \t3. Jupiter");
System.out.println("\t4. Saturn\t5. Uranus\t6. Neptune");
System.out.print("\nWhich planet are you visiting? ");
planetNumb = keyboard.nextInt();
System.out.println();
if (planetNumb == 1)
{
System.out.println("Your weight would be " + weight*0.78 + " pounds on that planet.");
}
if ( planetNumb == 2)
{
System.out.println("Your weight would be " + weight*0.39 + " pounds on that planet.");
}
if ( planetNumb == 3)
{
System.out.println("Your weight would be " + weight*2.65 + " pounds on that planet.");
}
if ( planetNumb == 4)
{
System.out.println("Your weight would be " + weight*1.17 + " pounds on that planet.");
}
if ( planetNumb == 5)
{
System.out.println("Your weight would be " + weight*1.05 + " pounds on that planet.");
}
if ( planetNumb == 6)
{
System.out.println("Your weight would be " + weight*1.23 + " pounds on that planet.");
}
}
}
Picture of the output