Skip to content

Commit 41226db

Browse files
committed
Draft 1 with shuttle calcualations
1 parent 8e1ffbc commit 41226db

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed
Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,39 @@
11
// Declare and assign the variables below
2+
let shuttleName = "Determination";
3+
let speed = 17500;
4+
let distToMars = 225000000;
5+
let distToMoon = 384400;
6+
let mpk = 0.621;
27

38
// Use console.log to print the 'typeof' each variable. Print one item per line.
9+
console.log(typeof shuttleName);
10+
console.log(typeof speed);
11+
console.log(typeof distToMars);
12+
console.log(typeof distToMoon);
13+
console.log(typeof mpk);
414

515
// Calculate a space mission below
616

17+
let milesToMars = mpk*distToMars;
18+
19+
//miles/shuttle speed
20+
let hoursToMars = milesToMars/speed;
21+
22+
let daysToMars = hoursToMars/24;
23+
724
// Print the results of the space mission calculations below
25+
console.log(shuttleName + " will take " + daysToMars + " days to reach Mars.");
826

927
// Calculate a trip to the moon below
1028

11-
// Print the results of the trip to the moon below
29+
let milesToMoon = mpk*distToMoon;
30+
31+
let hoursToMoon = milesToMoon/speed;
32+
33+
let daysToMoon = hoursToMoon/24;
34+
35+
// Print the results of the trip to the moon below
36+
37+
console.log(shuttleName + " will take " + daysToMoon + " days to reach the Moon.");
38+
console.log(shuttleName);
39+

0 commit comments

Comments
 (0)