1
1
// Declare and assign the variables below
2
+ let spaceShuttle = 'Determination' ;
3
+ let shuttleSpeedMph = 17500 ;
4
+ let distanceToMarsKm = 225000000 ;
5
+ let distancetoMoonKm = 384400 ;
6
+ const milesPerKm = 0.621 ;
7
+
8
+
2
9
3
10
// Use console.log to print the 'typeof' each variable. Print one item per line.
11
+ // console.log(typeof (spaceShuttle));
12
+ // console.log(typeof (shuttleSpeedMph));
13
+ // console.log(typeof (distanceToMarsKm));
14
+ // console.log(typeof (distancetoMoonKm));
15
+ // console.log(typeof (milesPerKM));
16
+
4
17
5
18
// Calculate a space mission below
19
+ let milesToMars = distanceToMarsKm * milesPerKm ;
20
+ let hoursToMars = milesToMars / shuttleSpeedMph ;
21
+ let daysToMars = hoursToMars / 24 ;
22
+
6
23
7
24
// Print the results of the space mission calculations below
25
+ console . log ( spaceShuttle + " will take " + daysToMars + " days to reach Mars" ) ;
8
26
9
27
// Calculate a trip to the moon below
10
-
11
- // Print the results of the trip to the moon below
28
+ let milesToMoon = distancetoMoonKm * milesPerKm ;
29
+ let hoursToMoon = milesToMoon / shuttleSpeedMph ;
30
+ let daysToMoon = hoursToMoon / 24 ;
31
+ // Print the results of the trip to the moon below
32
+ console . log ( spaceShuttle + " will take " + daysToMoon + " days to reach the Moon" ) ;
0 commit comments