-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathspaceboxer.c
50 lines (40 loc) · 958 Bytes
/
spaceboxer.c
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
// Team Knicks
// David Fang, Charlie Chen & Rui Yan
#include <stdio.h>
int main() {
float weight;
int planet;
printf("Please enter your current earth weight: ");
scanf("%f", &weight);
printf("\nI have information for the following planets: \n");
printf(" 1. Venus 2. Mars 3. Jupiter \n");
printf(" 4. Saturn 5. Uranus 6. Neptune \n\n");
printf("Which planet are you visiting? ");
scanf("%d", &planet);
if (planet == 1)
{
weight = weight * 0.78;
}
else if (planet == 2)
{
weight = weight * 0.39;
}
else if (planet == 3)
{
weight = weight * 2.65;
}
else if (planet == 4)
{
weight = weight * 1.17;
}
else if (planet == 5)
{
weight = weight * 1.05;
}
else if (planet == 6)
{
weight = weight * 1.23;
}
printf("\nYour weight would be %.2f on that planet.\n", weight);
return 0;
}