Skip to content

Commit 8c9f03b

Browse files
committed
exercise 1
1 parent 9803b43 commit 8c9f03b

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

booleans-and-conditionals/exercises/part-1.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
// Declare and initialize the variables for exercise 1 here:
22

3+
let engineIndicatorLight = "red blinking"
4+
let spaceSuitsOn = true
5+
let shuttleCabinReady = true
6+
let crewStatus = spaceSuitsOn && shuttleCabinReady
7+
let computerStatusCode = 200
8+
let shuttleSpeed = 15000
9+
310
// BEFORE running the code, predict what will be printed to the console by the following statements:
411

512
if (engineIndicatorLight === "green") {
@@ -9,3 +16,21 @@ if (engineIndicatorLight === "green") {
916
} else {
1017
console.log("engines are off");
1118
}
19+
20+
if (crewStatus === true) {
21+
console.log ("crew ready")
22+
} else {console.log ("crew not ready")}
23+
24+
if (computerStatusCode === 200) {
25+
console.log ("Please stand by. Computer is rebooting.")}
26+
else if (computerStatusCode === 400) {
27+
console.log ("Success! Computer online.")}
28+
else ("ALERT: Computer Offline!")
29+
30+
console.log (shuttleSpeed)
31+
if (shuttleSpeed > 17500) {
32+
console.log("ALERT: Escape velocity reached!");
33+
} else if (shuttleSpeed < 8000) {
34+
console.log ("ALERT: cannot maintain orbit!");
35+
} else {
36+
console.log ("Stable speed")}

0 commit comments

Comments
 (0)