Skip to content

Commit 1396c0f

Browse files
committed
debugging exercises completed
1 parent 8b381d5 commit 1396c0f

File tree

7 files changed

+20
-8
lines changed

7 files changed

+20
-8
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/DebuggingLogicErrors2.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ if (fuelLevel >= 20000) {
1717
launchReady = false;
1818
}
1919

20+
console.log(launchReady);
21+
2022
// if (crewStatus && computerStatus === 'green'){
2123
// console.log('Crew & computer cleared.');
2224
// launchReady = true;

errors-and-debugging/exercises/DebuggingLogicErrors3.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ if (crewStatus && computerStatus === 'green'){
2626
launchReady = false;
2727
}
2828

29+
console.log(launchReady);
30+
2931
// if (launchReady) {
3032
// console.log('10, 9, 8, 7, 6, 5, 4, 3, 2, 1...');
3133
// console.log('Liftoff!');

errors-and-debugging/exercises/DebuggingLogicErrors5.js

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

1011
if (fuelLevel >= 20000) {
1112
console.log('Fuel level cleared.');
@@ -19,10 +20,17 @@ console.log("launchReady = ", launchReady);
1920

2021
if (crewStatus && computerStatus === 'green'){
2122
console.log('Crew & computer cleared.');
22-
launchReady = true;
23+
crewReady = true;
2324
} else {
2425
console.log('WARNING: Crew or computer not ready!');
25-
launchReady = false;
26+
crewReady = false;
2627
}
2728

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

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)