From fa44cd7ffb03da06a6f62c81c2604d619d4f61ec Mon Sep 17 00:00:00 2001 From: AnuKodeRepo Date: Wed, 9 Sep 2026 00:00:53 +0000 Subject: [PATCH 1/3] Javascript First exercise --- .../code-execution/exercises/practice.js | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/tutorials/01-basic-syntax/code-execution/exercises/practice.js b/tutorials/01-basic-syntax/code-execution/exercises/practice.js index 8816d8c..eaceefa 100644 --- a/tutorials/01-basic-syntax/code-execution/exercises/practice.js +++ b/tutorials/01-basic-syntax/code-execution/exercises/practice.js @@ -7,16 +7,20 @@ // JAVA // JAVASCRIPT -word = word + "PT"; -word = word + "VA"; -word = word + "RI"; -word = word + "SC"; +let word = ""; + word = word + "JA"; +word = word + "VA"; -let word = ""; console.log(word); + +word = word + "SC"; +word = word + "PT"; +word = word + "RI"; + console.log(word); + // Run the file before moving on to ensure you get the expected result. /** DATA MANIPULATION **/ @@ -35,6 +39,7 @@ console.log(word); // IMPORTANT: Do not edit the 6 existing lines of code; add NEW lines of code only. + let num1 = 56; let num2 = 121; let num3 = 73; @@ -42,6 +47,15 @@ let num4 = 24; let num5 = 88; let num6 = 95; +num1 = num1-5; +num2 = num2+1; +num3 = num3+1; +num4 = num4-5; +num5 = num5-5; +num6 = num6+1; + +console.log(num1+num2+num3+num4+num5+num6); + // All done? Great job! Understanding how JavaScript executes and evaluates code is // important. Keep these principles in mind as you solve future problems! From b5e7cf42b5454f264c4b917bd215616802f74132 Mon Sep 17 00:00:00 2001 From: AnuKodeRepo Date: Mon, 14 Sep 2026 19:18:05 +0000 Subject: [PATCH 2/3] Errors-Debugging Exercise1 --- .../syntax-and-runtime-errors/exercises/practice1.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tutorials/03-errors-and-debugging/syntax-and-runtime-errors/exercises/practice1.js b/tutorials/03-errors-and-debugging/syntax-and-runtime-errors/exercises/practice1.js index 8897ab5..a8645cc 100644 --- a/tutorials/03-errors-and-debugging/syntax-and-runtime-errors/exercises/practice1.js +++ b/tutorials/03-errors-and-debugging/syntax-and-runtime-errors/exercises/practice1.js @@ -13,7 +13,7 @@ let fuel = 90; TODO: Un-comment the line below and run the program to see the error message, then fix the code and re-run to verify. */ -// console.log("Fuel level is " fuel + '%"); + console.log("Fuel level is "+fuel +"%"); /** EXERCISE 2: THE RUNTIME CRASH **/ @@ -21,9 +21,10 @@ let fuel = 90; TODO: Un-comment the line below and run the program to see the error message, then fix the code and re-run to verify. */ -// console.log(navCoordinate); + let navCoordinate = "Sector-7G"; +console.log(navCoordinate); /** EXERCISE 3: THE TYPO BLUNDER **/ @@ -33,7 +34,7 @@ let oxygen = 100; TODO: Un-comment the line below and run the program to see the error message, then fix the code and re-run to verify. */ -// console.log(oxygen.toString); + console.log(oxygen.toString()); // HINT: toString is not a property — it's a method! Do a little research // on the difference if you need to. From 78b4cfb3661af1ee31948328d92a7b72b6c368c6 Mon Sep 17 00:00:00 2001 From: AnuKodeRepo Date: Mon, 14 Sep 2026 19:44:32 +0000 Subject: [PATCH 3/3] Errors-debugging exercise2 --- .../exercises/practice2.js | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/tutorials/03-errors-and-debugging/syntax-and-runtime-errors/exercises/practice2.js b/tutorials/03-errors-and-debugging/syntax-and-runtime-errors/exercises/practice2.js index 9c5208a..67b0b86 100644 --- a/tutorials/03-errors-and-debugging/syntax-and-runtime-errors/exercises/practice2.js +++ b/tutorials/03-errors-and-debugging/syntax-and-runtime-errors/exercises/practice2.js @@ -20,7 +20,7 @@ console.log("--- INITIALIZING MISSION CONTROL ---"); TODO: Un-comment the line below and run the program to see the error message, then fix the code and re-run to verify. */ -// let pilotName = input.question("Enter Pilot Name: "; + let pilotName = input.question("Enter Pilot Name: "); // --- 2. ENGINE STATUS CHECK --- @@ -31,13 +31,15 @@ let checkEngines = input.question("Perform engine diagnostic? (Y/N): "); TODO: Un-comment the if/else statement below and run the program to see the error message, then fix the code and re-run to verify. */ -// if (checkEngines === "Y") { -// console.log(`Engine Health at ${engineHealth}%`); -// engineStatus = "Ready"; -// let engineHealth = 100; -// } else { -// console.log("Skipping engine diagnostic..."); -// } + + if (checkEngines === "Y" || checkEngines === "y") { + let engineHealth = 100; + console.log(`Engine Health at ${engineHealth}%`); + engineStatus = "Ready"; + +} else { + console.log("Skipping engine diagnostic..."); + } // --- 3. CARGO WEIGHT CALCULATION --- @@ -47,15 +49,15 @@ console.log("\n--- CARGO BAY CHECK ---"); TODO: Un-comment the line below and run the program to see the error message, then fix the code and re-run to verify. */ -// let crateCount = input.questionInt "How many crates are being loaded? " ; + let crateCount = input.questionInt("How many crates are being loaded? ") ; /* TODO: Un-comment the three lines of code below and run the program to see the error message, then fix the code and re-run to verify. */ -// let weightPerCrate = 50; -// let totalWeight = crateCount * weightPerCrate; -// console.log('Total Cargo Weight: ${totalWeight}kg'); + let weightPerCrate = 50; + let totalWeight = crateCount * weightPerCrate; + console.log(`Total Cargo Weight: ${totalWeight}kg`); // --- 4. FINAL LAUNCH LOGIC --- @@ -65,7 +67,9 @@ console.log("\n--- FINAL STATUS ---"); TODO: Un-comment the if/else statement below and run the program to see the error message, then fix the code and re-run to verify. */ -// if (engineStatus === "Ready" && totalWeight < 1000) -// console.log("All systems GO. Launching " + pilotName + into orbit!"); -// } else { -// console.log("Launch ABORTED. Check engine status or cargo weight."); + +if (engineStatus === "Ready" && totalWeight < 1000){ + console.log("All systems GO. Launching " + pilotName + "into orbit!"); + } else { + console.log("Launch ABORTED. Check engine status or cargo weight."); + }