1
1
// Declare and assign the variables below
2
+ let shuttle = 'determination' ;
3
+ let shuttleSpeed = 17500 ;
4
+ let distanceMars = 225000000 ;
5
+ let distanceMoon = 384400 ;
6
+ const milesPerKm = 0.621 ;
2
7
3
8
// Use console.log to print the 'typeof' each variable. Print one item per line.
9
+ console . log ( typeof shuttle ) ;
10
+ console . log ( typeof shuttleSpeed ) ;
11
+ console . log ( typeof distanceMars ) ;
12
+ console . log ( typeof distanceMoon ) ;
13
+ console . log ( typeof milesPerKm ) ;
14
+
4
15
5
16
// Calculate a space mission below
17
+ let milesMars = distanceMars * milesPerKm ;
18
+ console . log ( milesMars ) ;
19
+ let hoursToMars = ( milesMars / shuttleSpeed ) ;
20
+ console . log ( hoursToMars ) ;
21
+ let daysToMars = hoursToMars / 24 ;
22
+ console . log ( daysToMars ) ;
23
+
24
+
25
+
6
26
7
- // Print the results of the space mission calculations below
8
27
28
+ // Print the results of the space mission calculations below
29
+ console . log ( shuttle + " will take " + daysToMars + " days to reach Mars." )
9
30
// Calculate a trip to the moon below
31
+ let milesToMoon = distanceMoon * milesPerKm ;
32
+ console . log ( milesToMoon ) ;
33
+ let hoursToMoon = milesToMoon / shuttleSpeed ;
34
+ console . log ( hoursToMoon ) ;
35
+ let daysToMoon = hoursToMoon / 24 ;
36
+ console . log ( daysToMoon ) ;
37
+
38
+
39
+
10
40
11
- // Print the results of the trip to the moon below
41
+ // Print the results of the trip to the moon below
42
+ console . log ( shuttle + ' will take ' + daysToMoon + ' days to reach the moon.' ) ;
0 commit comments