Assignment 38, Space Boxing
Code
///Name: Stella Koliavas
///Period: 5
///Program Name: Space Boxing
///File Name: SpaceBoxing.java
///Date Finshed: 10/28/15
import java.util.Scanner;
public class SpaceBoxing
{
public static void main (String [] args)
{
Scanner siri = new Scanner(System.in);
int weight, number;
System.out.print(" What's your earth weight? ");
weight = siri.nextInt();
System.out.println("I Have some info about the following planets: ");
System.out.println("\t 1.Jupiter \t 2.Saturn \t 3.Uranus ");
System.out.println("\t 4.Neptune \t 5.Venus \t 6.Mars");
System.out.print("Which planet are you visiting, please type number in ");
number = siri.nextInt();
if (number == 1)
{
System.out.println("Your weight would be " + weight * 2.65 + " pounds on that planet.");
}
else if (number == 2)
{
System.out.println("Your weight would be " + weight * 1.17 + " pounds on that planet.");
}
else if (number == 3)
{
System.out.println("Your weight would be " + weight * 1.05 + " pounds on that planet.");
}
else if (number == 4)
{
System.out.println("Your weight would be " + weight * 1.23 + " pounds on that planet.");
}
else if (number == 5)
{
System.out.println("Your weight would be " + weight * .78 + " pounds on that planet.");
}
else if(number == 6)
{
System.out.println("Your weight would be " + weight * .39 + " pounds on that planet.");
}
}
}
Picture of the output