Skip to content

Commit 824d987

Browse files
committed
FIRST ASSIGNMENT
1 parent 9e88293 commit 824d987

File tree

1 file changed

+42
-1
lines changed

1 file changed

+42
-1
lines changed
Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,52 @@
11
// Declare and assign the variables below
22

3+
let spaceShuttleName = "Determination";
4+
5+
let shuttleSpeedMph = 17500;
6+
7+
let distanceToMarsKm = 225000000;
8+
9+
let distanceMoonKm = 384400;
10+
11+
let milesPerKilometer = 0.621;
12+
13+
14+
15+
316
// Use console.log to print the 'typeof' each variable. Print one item per line.
417

18+
console.log(typeof spaceShuttleName);
19+
20+
console.log(typeof shuttleSpeedMph);
21+
22+
console.log(typeof distanceToMarsKm);
23+
24+
console.log(typeof distanceMoonKm);
25+
26+
console.log(typeof milesPerKilometer);
27+
28+
529
// Calculate a space mission below
630

31+
let milesToMars = distanceToMarsKm * milesPerKilometer;
32+
33+
let hoursToMars = milesToMars / shuttleSpeedMph;
34+
35+
let daysToMars = hoursToMars / 24;
36+
37+
738
// Print the results of the space mission calculations below
839

40+
console.log(spaceShuttleName + " will take " + daysToMars + " to get to Mars.");
41+
942
// Calculate a trip to the moon below
1043

11-
// Print the results of the trip to the moon below
44+
let milesToMoon = distanceMoonKm * milesPerKilometer;
45+
46+
let hoursToMoon = milesToMoon / shuttleSpeedMph;
47+
48+
let daysToMoon = hoursToMoon / 24;
49+
50+
// Print the results of the trip to the moon below
51+
52+
console.log(spaceShuttleName + " will take " + daysToMoon + " to get to the Moon.");

0 commit comments

Comments
 (0)