-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSpaceBoxing.java
More file actions
58 lines (45 loc) · 1.16 KB
/
SpaceBoxing.java
File metadata and controls
58 lines (45 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import java.util.Scanner;
public class SpaceBoxing
{
public static void main ( String[] args )
{
Double venus, mars, jupiter, saturn, uranus, neptune, weight,choice;
venus = 0.78;
mars = 0.39;
jupiter = 2.65;
saturn = 1.17;
uranus = 1.05;
neptune = 1.23;
System.out.println("Please enter your weight");
Scanner keyboard = new Scanner(System.in);
weight = keyboard.nextDouble();
System.out.println("Choose a planet");
System.out.println("1. Venus 2. Mars 3. Jupiter");
System.out.println("4. Saturn 5. Uranus 6. Neptune");
choice = keyboard.nextDouble();
if ( choice == 1 )
{
System.out.println( "Yourweight is" + weight/venus);
}
if ( choice == 2 )
{
System.out.println( "Yourweight is" + weight/mars);
}
if ( choice == 3 )
{
System.out.println( "Yourweight is" + weight/jupiter);
}
if ( choice == 4 )
{
System.out.println( "Yourweight is" + weight/saturn + "in saturn");
}
if ( choice == 5 )
{
System.out.println( "Yourweight is" + weight/uranus + "in uranus" );
}
if ( choice == 6 )
{
System.out.println( "Yourweight is" + weight/neptune + "in neptune");
}
}
}