Skip to content

Commit b18f4d5

Browse files
committed
modified: data-and-variables/exercises/data-and-variables-exercises.js
1 parent e888691 commit b18f4d5

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed
Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,37 @@
11
// Declare and assign the variables below
22
let name = "Determination";
33
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+
78
// Use console.log to print the 'typeof' each variable. Print one item per line.
89
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+
1015
// Calculate a space mission below
1116

17+
let milesToMars = marsDistanceK * mpk;
18+
19+
let hoursToMars = milesToMars / speed;
20+
21+
let daysToMars = hoursToMars / 24;
22+
1223
// Print the results of the space mission calculations below
1324

25+
console.log(daysToMars);
26+
1427
// Calculate a trip to the moon below
1528

29+
let milesToMoon = moonDistanceK * mpk;
30+
31+
let hoursToMoon = milesToMoon / speed;
32+
33+
let daysToMoon = hoursToMoon / 24;
34+
1635
// Print the results of the trip to the moon below
36+
37+
console.log(daysToMoon);

0 commit comments

Comments
 (0)