Skip to content

Commit b9d5844

Browse files
committed
Homework Space Mission Submission
1 parent abe8c86 commit b9d5844

1 file changed

Lines changed: 20 additions & 1 deletion

File tree

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,30 @@
11
// Declare and assign the variables below
2+
let nameOfTheSpaceShuttle = 'determination';
3+
let shuttleSpeed = 17500;
4+
let distanceToMars = 225000000;
5+
let distanceToTheMoon = 3844000;
6+
const milesPerKilometer = 0.621;
27

38
// Use console.log to print the 'typeof' each variable. Print one item per line.
9+
console.log (typeof 'determination')
10+
console.log (typeof 17500)
11+
console.log (typeof 225000000)
12+
console.log (typeof 3844000)
13+
console.log (typeof 0.621)
414

515
// Calculate a space mission below
16+
let milesToMars = distanceToMars * milesPerKilometer;
17+
let hoursToMars = milesToMars / shuttleSpeed;
18+
let daysToMars = hoursToMars / 24;
619

720
// Print the results of the space mission calculations below
21+
console.log (nameOfTheSpaceShuttle," will take ",daysToMars, " days to reach mars.");
822

923
// Calculate a trip to the moon below
1024

11-
// Print the results of the trip to the moon below
25+
let milesToMoon = distanceToTheMoon * milesPerKilometer;
26+
let hoursToMoon = milesToMoon / shuttleSpeed;
27+
let daysToMoon = hoursToMoon / 24;
28+
29+
// Print the results of the trip to the moon below
30+
console.log (nameOfTheSpaceShuttle," will take ",daysToMoon, " days to reach the moon.");

0 commit comments

Comments
 (0)