Skip to content

Commit 22ac3d7

Browse files
committed
completed exercise
1 parent abe8c86 commit 22ac3d7

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed
Lines changed: 19 additions & 5 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 shuttleSpeedMph = 17500;
4+
let distanceToMarsKm = 225000000;
5+
let distanceToMoonKm = 38400;
6+
const milesPerKm = 0.621;
27

38
// Use console.log to print the 'typeof' each variable. Print one item per line.
4-
9+
console.log (typeof 'shuttleName');
10+
console.log (typeof 'shuttleSpeedMph');
11+
console.log (typeof 'distanceToMarsKm');
12+
console.log (typeof 'distanceToMoonKm');
13+
console.log (typeof 'milesPerKm');
514
// Calculate a space mission below
6-
15+
let milesToMars = distanceToMarsKm * milesPerKm;
16+
let hoursToMars = milesToMars / shuttleSpeedMph;
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-
11-
// Print the results of the trip to the moon below
21+
let milesToMoon = distanceToMoonKm * milesPerKm;
22+
let hoursToMoon = milesToMoon / shuttleSpeedMph;
23+
let daysToMoon = hoursToMoon / 24;
24+
// Print the results of the trip to the moon below
25+
console.log(shuttleName + " will take " + daysToMoon + " days to reach the Moon.");

0 commit comments

Comments
 (0)