1
1
// Declare and assign the variables below
2
2
3
+ let spaceShuttleName = "Determination" ;
4
+
5
+ let shuttleSpeedMph = 17500 ;
6
+
7
+ let distanceToMarsKm = 225000000 ;
8
+
9
+ let distanceMoonKm = 384400 ;
10
+
11
+ let milesPerKilometer = 0.621 ;
12
+
13
+
14
+
15
+
3
16
// Use console.log to print the 'typeof' each variable. Print one item per line.
4
17
18
+ console . log ( typeof spaceShuttleName ) ;
19
+
20
+ console . log ( typeof shuttleSpeedMph ) ;
21
+
22
+ console . log ( typeof distanceToMarsKm ) ;
23
+
24
+ console . log ( typeof distanceMoonKm ) ;
25
+
26
+ console . log ( typeof milesPerKilometer ) ;
27
+
28
+
5
29
// Calculate a space mission below
6
30
31
+ let milesToMars = distanceToMarsKm * milesPerKilometer ;
32
+
33
+ let hoursToMars = milesToMars / shuttleSpeedMph ;
34
+
35
+ let daysToMars = hoursToMars / 24 ;
36
+
37
+
7
38
// Print the results of the space mission calculations below
8
39
40
+ console . log ( spaceShuttleName + " will take " + daysToMars + " to get to Mars." ) ;
41
+
9
42
// Calculate a trip to the moon below
10
43
11
- // Print the results of the trip to the moon below
44
+ let milesToMoon = distanceMoonKm * milesPerKilometer ;
45
+
46
+ let hoursToMoon = milesToMoon / shuttleSpeedMph ;
47
+
48
+ let daysToMoon = hoursToMoon / 24 ;
49
+
50
+ // Print the results of the trip to the moon below
51
+
52
+ console . log ( spaceShuttleName + " will take " + daysToMoon + " to get to the Moon." ) ;
0 commit comments