File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed
data-and-variables/exercises Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change 1
1
// Declare and assign the variables below
2
+ let shuttleName = 'Determination' ;
3
+ let shuttleSpeed = 17500 ;
4
+ let marsDistance = 225000000 ;
5
+ let moonDistance = 384400 ;
6
+ const milesKilometer = 0.621 ;
2
7
3
8
// Use console.log to print the 'typeof' each variable. Print one item per line.
4
9
10
+ console . log ( typeof shuttleName ) ;
11
+ console . log ( typeof shuttleSpeed ) ;
12
+ console . log ( typeof marsDistance ) ;
13
+ console . log ( typeof moonDistance ) ;
14
+ console . log ( typeof milesKilometer ) ;
15
+
5
16
// Calculate a space mission below
6
17
18
+ let milesToMars = marsDistance * milesKilometer ;
19
+ let hoursToMars = milesToMars / shuttleSpeed ;
20
+ let daysToMars = hoursToMars / 24 ;
21
+
7
22
// Print the results of the space mission calculations below
8
23
24
+ console . log ( shuttleName + " will take " + daysToMars + " days to reach the Moon." ) ;
25
+
9
26
// Calculate a trip to the moon below
10
27
11
- // Print the results of the trip to the moon below
28
+ let milesToMoon = moonDistance * milesKilometer ;
29
+ let hoursToMoon = milesToMoon / shuttleSpeed ;
30
+ let daysToMoon = hoursToMoon / 24 ;
31
+
32
+ // Print the results of the trip to the moon below
33
+
34
+ console . log ( shuttleName + " will take " + daysToMoon + " days to reach the Moon." ) ;
You can’t perform that action at this time.
0 commit comments