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