You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: booleans-and-conditionals/exercises/part-2.js
+34-1Lines changed: 34 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -9,13 +9,46 @@ let shuttleSpeed = 15000;
9
9
10
10
// a) If crewStatus is true, print "Crew Ready" else print "Crew Not Ready".
11
11
12
+
if(crewStatus){
13
+
console.log("Crew Ready");
14
+
}else{
15
+
console.log("Crew Not Ready");
16
+
}
12
17
13
18
// b) If computerStatusCode is 200, print "Please stand by. Computer is rebooting." Else if computerStatusCode is 400, print "Success! Computer online." Else print "ALERT: Computer offline!"
14
19
20
+
if(computerStatusCode===200){
21
+
console.log("Please stand by. Computer is rebooting.");
22
+
}elseif(computerStatusCode===400){
23
+
console.log("Success! Computer online.");
24
+
}else{
25
+
console.log("ALERT: Computer offline!");
26
+
}
15
27
16
28
// c) If shuttleSpeed is > 17,500, print "ALERT: Escape velocity reached!" Else if shuttleSpeed is < 8000, print "ALERT: Cannot maintain orbit!" Else print "Stable speed".
17
29
30
+
if(shuttleSpeed>17500){
31
+
console.log("ALERT: Escape velocity reached!");
32
+
}elseif(shuttleSpeed<8000){
33
+
console.log("ALERT: Cannot maintain orbit!");
34
+
}else{
35
+
console.log("Stable speed.");
36
+
}
37
+
18
38
19
39
// 4) PREDICT: Do the code blocks shown in the 'predict.txt' file produce the same result?
0 commit comments