Skip to content

Commit 032f08f

Browse files
committed
<type a message here>
1 parent abe8c86 commit 032f08f

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed
Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
11
// Declare and assign the variables below
2-
2+
let SpaceShuttle= "Screaming Eagle";
3+
let ShuttleSpeed=17500;
4+
let DistanceToMars=225000000;
5+
let DistanceToTheMoon=384400;
6+
let MilesPerKIlometer=.621;
37
// Use console.log to print the 'typeof' each variable. Print one item per line.
4-
8+
console.log(typeof SpaceShuttle);
9+
console.log(typeof ShuttleSpeed);
10+
console.log(typeof DistanceToMars);
11+
console.log(typeof DistanceToTheMoon);
12+
console.log(typeof MilesPerKIlometer);
513
// Calculate a space mission below
6-
14+
let MilesToMars= DistanceToMars*MilesPerKIlometer;
15+
let HoursToMars= MilesToMars/ShuttleSpeed;
16+
let DaysToMars= HoursToMars/24;
717
// Print the results of the space mission calculations below
8-
18+
console.log(SpaceShuttle,"will take",DaysToMars,"days to reach Mars.")
919
// Calculate a trip to the moon below
1020

11-
// Print the results of the trip to the moon below
21+
// Print the results of the trip to the moon below
22+
23+
let MilesToMoon=DistanceToTheMoon*MilesPerKIlometer;
24+
let HoursToMoon=MilesToMoon/ShuttleSpeed;
25+
let DaysToMoon=HoursToMoon/24;
26+
27+
console.log(SpaceShuttle,"will take",DaysToMoon,"days to reach the Mooooon");

how-to-write-code/consolelogexamples01.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ console.log("What","do","commas","do?");
44
console.log("Does", "adding", "space", "matter?");
55
console.log('Launch' + 'Code');
66
console.log("LaunchCode was founded in", 2013);
7+
console.log(1 + 5 % 3)

0 commit comments

Comments
 (0)