Skip to content

Commit 3b8316b

Browse files
committed
finished exercises
1 parent 935842b commit 3b8316b

9 files changed

+22
-15
lines changed

errors-and-debugging/exercises/Debugging1stSyntaxError.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
let launchReady = false;
55
let fuelLevel = 17000;
66

7-
if (fuelLevel >= 20000 {
7+
if (fuelLevel >= 20000) {
88
console.log('Fuel level cleared.');
99
launchReady = true;
1010
} else {

errors-and-debugging/exercises/DebuggingLogicErrors1.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Run this sample code as-is and examine the output.
2-
// Should the shuttle have launched?
3-
// Did it?
2+
// Should the shuttle have launched? no
3+
// Did it? yes
44
// Do not worry about fixing the code yet, we will do that in the next series of exercises.
55

66
let launchReady = false;

errors-and-debugging/exercises/DebuggingLogicErrors2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ if (fuelLevel >= 20000) {
1616
console.log('WARNING: Insufficient fuel!');
1717
launchReady = false;
1818
}
19-
19+
console.log(launchReady)
2020
// if (crewStatus && computerStatus === 'green'){
2121
// console.log('Crew & computer cleared.');
2222
// launchReady = true;

errors-and-debugging/exercises/DebuggingLogicErrors3.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ if (crewStatus && computerStatus === 'green'){
2525
console.log('WARNING: Crew or computer not ready!');
2626
launchReady = false;
2727
}
28-
28+
console.log(launchReady)
2929
// if (launchReady) {
3030
// console.log('10, 9, 8, 7, 6, 5, 4, 3, 2, 1...');
3131
// console.log('Liftoff!');

errors-and-debugging/exercises/DebuggingLogicErrors4.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ if (fuelLevel >= 20000) {
1616
console.log('WARNING: Insufficient fuel!');
1717
launchReady = false;
1818
}
19-
19+
console.log(launchReady)
2020
console.log("launchReady = ", launchReady);
2121

2222
if (crewStatus && computerStatus === 'green'){
@@ -26,7 +26,7 @@ if (crewStatus && computerStatus === 'green'){
2626
console.log('WARNING: Crew or computer not ready!');
2727
launchReady = false;
2828
}
29-
29+
console.log(launchReady)
3030
console.log("launchReady = ", launchReady);
3131

3232
// if (launchReady) {

errors-and-debugging/exercises/DebuggingLogicErrors5.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,17 @@ let launchReady = false;
66
let fuelLevel = 17000;
77
let crewStatus = true;
88
let computerStatus = 'green';
9+
let fuelReady = false;
910

1011
if (fuelLevel >= 20000) {
1112
console.log('Fuel level cleared.');
12-
launchReady = true;
13+
fuelReady = true;
1314
} else {
1415
console.log('WARNING: Insufficient fuel!');
15-
launchReady = false;
16+
fuelReady = false;
1617
}
1718

18-
console.log("launchReady = ", launchReady);
19+
console.log("fuelReady = ", fuelReady);
1920

2021
if (crewStatus && computerStatus === 'green'){
2122
console.log('Crew & computer cleared.');
@@ -25,4 +26,10 @@ if (crewStatus && computerStatus === 'green'){
2526
launchReady = false;
2627
}
2728

28-
console.log("launchReady = ", launchReady);
29+
console.log("launchReady = ", launchReady);
30+
31+
if (launchReady && fuelReady === true){
32+
console.log("10,9,8,7,6,5,4,3,2,1, LIFTOFF!");
33+
} else {
34+
console.log("Launch Scrubbed");
35+
}

errors-and-debugging/exercises/DebuggingRuntimeErrors1.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
let launchReady = false;
55
let fuelLevel = 17000;
66

7-
if (fuellevel >= 20000) {
7+
if (fuelLevel >= 20000) {
88
console.log('Fuel level cleared.');
99
launchReady = true;
1010
} else {

errors-and-debugging/exercises/DebuggingRuntimeErrors2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if (launchReady) {
1414
console.log("Fed parrot...");
1515
console.log("6, 5, 4...");
1616
console.log("Ignition...");
17-
consoul.log("3, 2, 1...");
17+
console.log("3, 2, 1...");
1818
console.log("Liftoff!");
1919
} else {
2020
console.log("Launch scrubbed.");

errors-and-debugging/exercises/DebuggingSyntaxErrors2.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ let launchReady = false;
88
let crewStatus = true;
99
let computerStatus = 'green';
1010

11-
if (crewStatus &&& computerStatus === 'green'){
11+
if (crewStatus && computerStatus === 'green'){
1212
console.log('Crew & computer cleared.');
1313
launchReady = true;
1414
} else {
@@ -17,7 +17,7 @@ if (crewStatus &&& computerStatus === 'green'){
1717
}
1818

1919
if (launchReady) {
20-
console.log(("10, 9, 8, 7, 6, 5, 4, 3, 2, 1...");
20+
console.log("10, 9, 8, 7, 6, 5, 4, 3, 2, 1...");
2121
console.log("Fed parrot...");
2222
console.log("Ignition...");
2323
console.log("Liftoff!");

0 commit comments

Comments
 (0)