File tree 1 file changed +25
-0
lines changed
booleans-and-conditionals/exercises
1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 1
1
// Declare and initialize the variables for exercise 1 here:
2
2
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
+
3
10
// BEFORE running the code, predict what will be printed to the console by the following statements:
4
11
5
12
if ( engineIndicatorLight === "green" ) {
@@ -9,3 +16,21 @@ if (engineIndicatorLight === "green") {
9
16
} else {
10
17
console . log ( "engines are off" ) ;
11
18
}
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" ) }
You can’t perform that action at this time.
0 commit comments