Skip to content

Commit 8d7c834

Browse files
committed
finished class 1 Exercises
1 parent abe8c86 commit 8d7c834

File tree

1 file changed

+33
-2
lines changed

1 file changed

+33
-2
lines changed
Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,42 @@
11
// Declare and assign the variables below
2+
let shuttle = 'determination';
3+
let shuttleSpeed = 17500;
4+
let distanceMars = 225000000;
5+
let distanceMoon = 384400;
6+
const milesPerKm = 0.621;
27

38
// Use console.log to print the 'typeof' each variable. Print one item per line.
9+
console.log(typeof shuttle);
10+
console.log(typeof shuttleSpeed);
11+
console.log(typeof distanceMars);
12+
console.log(typeof distanceMoon);
13+
console.log(typeof milesPerKm);
14+
415

516
// Calculate a space mission below
17+
let milesMars = distanceMars * milesPerKm;
18+
console.log (milesMars);
19+
let hoursToMars = (milesMars / shuttleSpeed);
20+
console.log (hoursToMars);
21+
let daysToMars = hoursToMars / 24;
22+
console.log (daysToMars);
23+
24+
25+
626

7-
// Print the results of the space mission calculations below
827

28+
// Print the results of the space mission calculations below
29+
console.log (shuttle + " will take " + daysToMars + " days to reach Mars.")
930
// Calculate a trip to the moon below
31+
let milesToMoon = distanceMoon * milesPerKm;
32+
console.log (milesToMoon);
33+
let hoursToMoon = milesToMoon / shuttleSpeed;
34+
console.log (hoursToMoon);
35+
let daysToMoon = hoursToMoon / 24;
36+
console.log (daysToMoon);
37+
38+
39+
1040

11-
// Print the results of the trip to the moon below
41+
// Print the results of the trip to the moon below
42+
console.log (shuttle + ' will take ' + daysToMoon + ' days to reach the moon.');

0 commit comments

Comments
 (0)