Skip to content

Commit 1b2d229

Browse files
committed
<Printed data for Moon and Mars travel times.>
1 parent abe8c86 commit 1b2d229

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed
Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
11
// Declare and assign the variables below
2+
let shuttleName = "Determination";
3+
let speed = 17500;
4+
let kmToMars = 225000000;
5+
let kmToMoon = 384400;
6+
let milesPerKm = 0.621
27

38
// Use console.log to print the 'typeof' each variable. Print one item per line.
4-
9+
console.log(typeof "Determination");
10+
console.log(typeof 17500);
11+
console.log(typeof 225000000);
12+
console.log(typeof 384400);
13+
console.log(typeof 0.621);
514
// Calculate a space mission below
6-
15+
let milesToMars = kmToMars * milesPerKm;
16+
let hoursToMars = milesToMars / speed;
17+
let daysToMars = hoursToMars / 24;
718
// Print the results of the space mission calculations below
8-
19+
console.log(shuttleName + " will take " + daysToMars + " days to reach Mars.");
920
// Calculate a trip to the moon below
10-
21+
let milesToMoon = kmToMoon * milesPerKm;
22+
let hoursToMoon = milesToMoon / speed;
23+
let daysToMoon = hoursToMoon / 24;
24+
console.log(shuttleName + " will take " + daysToMoon + " days to reach the Moon.");
1125
// Print the results of the trip to the moon below

0 commit comments

Comments
 (0)