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