From d83f34c463f4b51c868f8be5d97f9d986c320086 Mon Sep 17 00:00:00 2001 From: Frumentius-Rev Date: Tue, 22 Sep 2026 17:17:31 +0100 Subject: [PATCH 01/20] Fix capitalise function --- Sprint-3/1-key-errors/0.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Sprint-3/1-key-errors/0.js b/Sprint-3/1-key-errors/0.js index 653d6f5a0..dbdb8825f 100644 --- a/Sprint-3/1-key-errors/0.js +++ b/Sprint-3/1-key-errors/0.js @@ -1,13 +1,22 @@ // Predict and explain first... -// =============> write your prediction here +// I believe this will cause an error because str is declared twice // call the function capitalise with a string input // interpret the error message and figure out why an error is occurring -function capitalise(str) { +/* function capitalise(str) { let str = `${str[0].toUpperCase()}${str.slice(1)}`; return str; } +*/ + +// The error happens because str is declared twice, once as a parameter & again with let +// If I give the new variable a different name, I hope it should work :) + + +function capitalise(str) { + let newString = `${str[0].toUpperCase()}${str.slice(1)}`; + return newString; +} -// =============> write your explanation here -// =============> write your new code here +console.log(capitalise("frumentius")); \ No newline at end of file From dc3752d79fbb84f69ddbb7b9b5a37998f3eca2b0 Mon Sep 17 00:00:00 2001 From: Frumentius-Rev Date: Tue, 22 Sep 2026 18:58:51 +0100 Subject: [PATCH 02/20] Fix % conversion --- Sprint-3/1-key-errors/1.js | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/Sprint-3/1-key-errors/1.js b/Sprint-3/1-key-errors/1.js index f2d56151f..4a69d5c76 100644 --- a/Sprint-3/1-key-errors/1.js +++ b/Sprint-3/1-key-errors/1.js @@ -1,10 +1,12 @@ // Predict and explain first... // Why will an error occur when this program runs? -// =============> write your prediction here +// Because decimalNumber is declared twice, once as a parameter and again with const // Try playing computer with the example to work out what is going on +/* + function convertToPercentage(decimalNumber) { const decimalNumber = 0.5; const percentage = `${decimalNumber * 100}%`; @@ -12,9 +14,19 @@ function convertToPercentage(decimalNumber) { return percentage; } -console.log(decimalNumber); +console.log(convertToPercentage(decimalNumber)); */ -// =============> write your explanation here +// decimalNumber is already a parameter, so declaring it again with const causes an error +// decimalNumber has already been declared as a parameter in the same function scope +// console.log(decimalNumber) is wrong because decimalNumber is not defined outside the function, +// so we need to call the function with a value // Finally, correct the code to fix the problem -// =============> write your new code here + +function convertToPercentage(decimalNumber) { + const percentage = `${decimalNumber * 100}%`; + + return percentage; +} + +console.log(convertToPercentage("26")); \ No newline at end of file From 53921fe9a9c992177303d0056d90d9036ee6846a Mon Sep 17 00:00:00 2001 From: Frumentius-Rev Date: Wed, 23 Sep 2026 22:18:08 +0100 Subject: [PATCH 03/20] Fix parameter name --- Sprint-3/1-key-errors/2.js | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/Sprint-3/1-key-errors/2.js b/Sprint-3/1-key-errors/2.js index aad57f7cf..b78aebccf 100644 --- a/Sprint-3/1-key-errors/2.js +++ b/Sprint-3/1-key-errors/2.js @@ -4,17 +4,30 @@ // this function should square any number but instead we're going to get an error // =============> write your prediction of the error here +// I think using 3 will cause an error as parameter +// A parameter must be a valid variable name, not a number -function square(3) { - return num * num; -} + /* function square(3){ + return num * num; -// =============> write the error message here +} + */ + +// =============> write the error message here +// SyntaxError: Unexpected number // =============> explain this error message here +// The parser sees the number 3 where it expects a valid parameter name, +// so it cannot understand the structure of the function +// It means we cannot use a number as a parameter name + // Finally, correct the code to fix the problem // =============> write your new code here +function square(num){ + return num * num; +} +console.log(square(7)); \ No newline at end of file From 62255c066b58f44d6fc8a9a4904d8630a5b874ac Mon Sep 17 00:00:00 2001 From: Frumentius-Rev Date: Thu, 24 Sep 2026 00:14:56 +0100 Subject: [PATCH 04/20] Debug return value --- Sprint-3/2-mandatory-debug/0.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Sprint-3/2-mandatory-debug/0.js b/Sprint-3/2-mandatory-debug/0.js index b27511b41..2d11688cc 100644 --- a/Sprint-3/2-mandatory-debug/0.js +++ b/Sprint-3/2-mandatory-debug/0.js @@ -1,14 +1,25 @@ // Predict and explain first... // =============> write your prediction here +// I believe the function will calculate 10 x 32 function multiply(a, b) { console.log(a * b); + } console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`); // =============> write your explanation here +// After calling multiply(10, 32), the result is undefined because there is no return statement +// It can still print 320 because console.log() prints the result inside the function + // Finally, correct the code to fix the problem // =============> write your new code here + +function multiply(a, b) { + console.log(a * b); + return a * b; +} +console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`); \ No newline at end of file From d423953790abe53860668a0443b524e63109efc3 Mon Sep 17 00:00:00 2001 From: Frumentius-Rev Date: Thu, 24 Sep 2026 00:31:13 +0100 Subject: [PATCH 05/20] Debug return statement --- Sprint-3/2-mandatory-debug/1.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Sprint-3/2-mandatory-debug/1.js b/Sprint-3/2-mandatory-debug/1.js index 37cedfbcf..94152f639 100644 --- a/Sprint-3/2-mandatory-debug/1.js +++ b/Sprint-3/2-mandatory-debug/1.js @@ -1,13 +1,22 @@ // Predict and explain first... // =============> write your prediction here +// I guess the function will return error or undefined because the return; -function sum(a, b) { +/*function sum(a, b) { return; a + b; } -console.log(`The sum of 10 and 32 is ${sum(10, 32)}`); +console.log(`The sum of 10 and 32 is ${sum(10, 32)}`); */ // =============> write your explanation here +// The problem is the semicolon immediately after return that prevent to reach out to a + b + // Finally, correct the code to fix the problem // =============> write your new code here + +function sum(a, b) { + return a + b; +} + +console.log(`The sum of 10 and 32 is ${sum(10, 32)}`); From 47e5c24c58ea321d6bf36db2098e54bbc0d42200 Mon Sep 17 00:00:00 2001 From: Frumentius-Rev Date: Thu, 24 Sep 2026 02:02:48 +0100 Subject: [PATCH 06/20] Debug last digit function --- Sprint-3/2-mandatory-debug/2.js | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/Sprint-3/2-mandatory-debug/2.js b/Sprint-3/2-mandatory-debug/2.js index 57d3f5dc3..71ba07caa 100644 --- a/Sprint-3/2-mandatory-debug/2.js +++ b/Sprint-3/2-mandatory-debug/2.js @@ -2,8 +2,9 @@ // Predict the output of the following code: // =============> Write your prediction here +// The output will be the same because we don't give the function a parameter -const num = 103; +/*const num = 103; function getLastDigit() { return num.toString().slice(-1); @@ -11,14 +12,32 @@ function getLastDigit() { console.log(`The last digit of 42 is ${getLastDigit(42)}`); console.log(`The last digit of 105 is ${getLastDigit(105)}`); -console.log(`The last digit of 806 is ${getLastDigit(806)}`); +console.log(`The last digit of 806 is ${getLastDigit(806)}`); */ // Now run the code and compare the output to your prediction // =============> write the output here +// The output is the same but the last digit is 3 + // Explain why the output is the way it is // =============> write your explanation here +// Because of the global variable and also because the function has no parameter + + // Finally, correct the code to fix the problem // =============> write your new code here +const num = 103; + +function getLastDigit(num) { + return num.toString().slice(-1); +} + +console.log(`The last digit of 42 is ${getLastDigit(42)}`); +console.log(`The last digit of 105 is ${getLastDigit(105)}`); +console.log(`The last digit of 806 is ${getLastDigit(806)}`); + + // This program should tell the user the last digit of each number. // Explain why getLastDigit is not working properly - correct the problem + +// Because the function was using the global variable, it ignored the arguments passed to it outside of the function box From 6189cca8484771a0748629cb8c0264461416742f Mon Sep 17 00:00:00 2001 From: Frumentius-Rev Date: Thu, 24 Sep 2026 12:39:01 +0100 Subject: [PATCH 07/20] Complete BMI function --- Sprint-3/3-mandatory-implement/1-bmi.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Sprint-3/3-mandatory-implement/1-bmi.js b/Sprint-3/3-mandatory-implement/1-bmi.js index 58b1085f1..3156afcaa 100644 --- a/Sprint-3/3-mandatory-implement/1-bmi.js +++ b/Sprint-3/3-mandatory-implement/1-bmi.js @@ -15,5 +15,12 @@ // It should return a string of their Body Mass Index to 1 decimal place function calculateBMI(weight, height) { - // return the BMI of someone based off their weight and height + let BMI = weight / (height * height) + + return BMI.toFixed(1); + + } +console.log(calculateBMI(62, 1.67)); + +// return the BMI of someone based off their weight and height \ No newline at end of file From d8b60b7b558c58a13beab38adca0977f4e120a32 Mon Sep 17 00:00:00 2001 From: Frumentius-Rev Date: Thu, 24 Sep 2026 14:11:42 +0100 Subject: [PATCH 08/20] Complete uppercase conversion --- Sprint-3/3-mandatory-implement/2-cases.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Sprint-3/3-mandatory-implement/2-cases.js b/Sprint-3/3-mandatory-implement/2-cases.js index 5b0ef77ad..825e82582 100644 --- a/Sprint-3/3-mandatory-implement/2-cases.js +++ b/Sprint-3/3-mandatory-implement/2-cases.js @@ -14,3 +14,10 @@ // You will need to come up with an appropriate name for the function // Use the MDN string documentation to help you find a solution // This might help https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase + +function toUpper(input) { + return input.replaceAll(" ", "_").toUpperCase(); + +} + +console.log(toUpper("alpha and omega")); From 20b12f0dce14dd551fe3d83f9b29f78f57a16ac2 Mon Sep 17 00:00:00 2001 From: Frumentius-Rev Date: Thu, 24 Sep 2026 15:14:47 +0100 Subject: [PATCH 09/20] =?UTF-8?q?Complete=20=C2=A3=20function?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sprint-3/3-mandatory-implement/3-to-pounds.js | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/Sprint-3/3-mandatory-implement/3-to-pounds.js b/Sprint-3/3-mandatory-implement/3-to-pounds.js index 10754da73..015428437 100644 --- a/Sprint-3/3-mandatory-implement/3-to-pounds.js +++ b/Sprint-3/3-mandatory-implement/3-to-pounds.js @@ -4,3 +4,31 @@ // You will need to declare a function called toPounds with an appropriately named parameter. // You should call this function a number of times to check it works for different inputs + + + + + +function toPounds(amount) { + const amountWithoutTrailingP = amount.substring( + 0, + amount.length - 1 +); + +const paddedPenceNumberString = amountWithoutTrailingP.padStart(3, "0"); +const pounds = paddedPenceNumberString.substring( + 0, + paddedPenceNumberString.length - 2 +); + +const pence = paddedPenceNumberString + .substring(paddedPenceNumberString.length - 2) + .padEnd(2, "0"); + + return (`£${pounds}.${pence}`) +} + + +console.log(toPounds("1250p")); + + From 706a763d8b69a14e0043b18d547d13fe1d1ebaec Mon Sep 17 00:00:00 2001 From: Frumentius-Rev Date: Thu, 24 Sep 2026 21:24:04 +0100 Subject: [PATCH 10/20] Complete function tracing exercise --- Sprint-3/4-mandatory-interpret/time-format.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sprint-3/4-mandatory-interpret/time-format.js b/Sprint-3/4-mandatory-interpret/time-format.js index c0dd9c9a5..07d82a99e 100644 --- a/Sprint-3/4-mandatory-interpret/time-format.js +++ b/Sprint-3/4-mandatory-interpret/time-format.js @@ -14,6 +14,7 @@ function formatTimeDisplay(seconds) { return `${pad(totalHours)}:${pad(remainingMinutes)}:${pad(remainingSeconds)}`; } +console.log(formatTimeDisplay(61)); // You will need to play computer with this example - use the Python Visualiser https://pythontutor.com/visualize.html#mode=edit // to help you answer these questions @@ -27,6 +28,7 @@ function formatTimeDisplay(seconds) { // b) What is the value assigned to num when pad is called for the first time? // =============> write your answer here +// 3 // c) What is the return value of pad when it is called for the first time? // =============> write your answer here From 7d4385b3de42ba72e0aa743c3fdccdffc90883a3 Mon Sep 17 00:00:00 2001 From: Frumentius-Rev Date: Thu, 24 Sep 2026 22:38:29 +0100 Subject: [PATCH 11/20] Complete function tracing answers --- Sprint-3/4-mandatory-interpret/time-format.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Sprint-3/4-mandatory-interpret/time-format.js b/Sprint-3/4-mandatory-interpret/time-format.js index 07d82a99e..4e775e407 100644 --- a/Sprint-3/4-mandatory-interpret/time-format.js +++ b/Sprint-3/4-mandatory-interpret/time-format.js @@ -22,19 +22,18 @@ console.log(formatTimeDisplay(61)); // Questions // a) When formatTimeDisplay is called how many times will pad be called? -// =============> write your answer here +// 3 // Call formatTimeDisplay with an input of 61, now answer the following: // b) What is the value assigned to num when pad is called for the first time? -// =============> write your answer here -// 3 +// 0 // c) What is the return value of pad when it is called for the first time? -// =============> write your answer here +// 00 // d) What is the value assigned to num when pad is called for the last time in this program? Explain your answer -// =============> write your answer here +// 1 // e) What is the return value of pad when it is called for the last time in this program? Explain your answer -// =============> write your answer here +// 01 From 107eaf263be4a5a93efd94d043545a762a6d2a14 Mon Sep 17 00:00:00 2001 From: Frumentius-Rev Date: Fri, 25 Sep 2026 10:16:44 +0100 Subject: [PATCH 12/20] Format Sprint 3 with Prettier --- Sprint-3/1-key-errors/0.js | 5 ++-- Sprint-3/1-key-errors/1.js | 2 +- Sprint-3/1-key-errors/2.js | 17 +++++------ Sprint-3/2-mandatory-debug/0.js | 7 ++--- Sprint-3/2-mandatory-debug/1.js | 2 +- Sprint-3/2-mandatory-debug/2.js | 6 ++-- Sprint-3/3-mandatory-implement/1-bmi.js | 8 ++--- Sprint-3/3-mandatory-implement/2-cases.js | 3 +- Sprint-3/3-mandatory-implement/3-to-pounds.js | 30 +++++++------------ Sprint-3/5-stretch-extend/format-time.js | 4 +-- 10 files changed, 32 insertions(+), 52 deletions(-) diff --git a/Sprint-3/1-key-errors/0.js b/Sprint-3/1-key-errors/0.js index dbdb8825f..9c862b436 100644 --- a/Sprint-3/1-key-errors/0.js +++ b/Sprint-3/1-key-errors/0.js @@ -11,12 +11,11 @@ */ // The error happens because str is declared twice, once as a parameter & again with let -// If I give the new variable a different name, I hope it should work :) - +// If I give the new variable a different name, I hope it should work :) function capitalise(str) { let newString = `${str[0].toUpperCase()}${str.slice(1)}`; return newString; } -console.log(capitalise("frumentius")); \ No newline at end of file +console.log(capitalise("frumentius")); diff --git a/Sprint-3/1-key-errors/1.js b/Sprint-3/1-key-errors/1.js index 4a69d5c76..cb9c2a3f9 100644 --- a/Sprint-3/1-key-errors/1.js +++ b/Sprint-3/1-key-errors/1.js @@ -29,4 +29,4 @@ function convertToPercentage(decimalNumber) { return percentage; } -console.log(convertToPercentage("26")); \ No newline at end of file +console.log(convertToPercentage("26")); diff --git a/Sprint-3/1-key-errors/2.js b/Sprint-3/1-key-errors/2.js index b78aebccf..c0330bf46 100644 --- a/Sprint-3/1-key-errors/2.js +++ b/Sprint-3/1-key-errors/2.js @@ -1,19 +1,18 @@ - // Predict and explain first BEFORE you run any code... // this function should square any number but instead we're going to get an error // =============> write your prediction of the error here // I think using 3 will cause an error as parameter -// A parameter must be a valid variable name, not a number +// A parameter must be a valid variable name, not a number - /* function square(3){ +/* function square(3){ return num * num; } */ - -// =============> write the error message here + +// =============> write the error message here // SyntaxError: Unexpected number // =============> explain this error message here @@ -21,13 +20,11 @@ // so it cannot understand the structure of the function // It means we cannot use a number as a parameter name - // Finally, correct the code to fix the problem // =============> write your new code here -function square(num){ - return num * num; - +function square(num) { + return num * num; } -console.log(square(7)); \ No newline at end of file +console.log(square(7)); diff --git a/Sprint-3/2-mandatory-debug/0.js b/Sprint-3/2-mandatory-debug/0.js index 2d11688cc..50956778d 100644 --- a/Sprint-3/2-mandatory-debug/0.js +++ b/Sprint-3/2-mandatory-debug/0.js @@ -1,18 +1,17 @@ // Predict and explain first... // =============> write your prediction here -// I believe the function will calculate 10 x 32 +// I believe the function will calculate 10 x 32 function multiply(a, b) { console.log(a * b); - } console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`); // =============> write your explanation here -// After calling multiply(10, 32), the result is undefined because there is no return statement +// After calling multiply(10, 32), the result is undefined because there is no return statement // It can still print 320 because console.log() prints the result inside the function // Finally, correct the code to fix the problem @@ -22,4 +21,4 @@ function multiply(a, b) { console.log(a * b); return a * b; } -console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`); \ No newline at end of file +console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`); diff --git a/Sprint-3/2-mandatory-debug/1.js b/Sprint-3/2-mandatory-debug/1.js index 94152f639..45d4b156f 100644 --- a/Sprint-3/2-mandatory-debug/1.js +++ b/Sprint-3/2-mandatory-debug/1.js @@ -1,6 +1,6 @@ // Predict and explain first... // =============> write your prediction here -// I guess the function will return error or undefined because the return; +// I guess the function will return error or undefined because the return; /*function sum(a, b) { return; diff --git a/Sprint-3/2-mandatory-debug/2.js b/Sprint-3/2-mandatory-debug/2.js index 71ba07caa..6eed48426 100644 --- a/Sprint-3/2-mandatory-debug/2.js +++ b/Sprint-3/2-mandatory-debug/2.js @@ -2,7 +2,7 @@ // Predict the output of the following code: // =============> Write your prediction here -// The output will be the same because we don't give the function a parameter +// The output will be the same because we don't give the function a parameter /*const num = 103; @@ -22,7 +22,6 @@ console.log(`The last digit of 806 is ${getLastDigit(806)}`); */ // =============> write your explanation here // Because of the global variable and also because the function has no parameter - // Finally, correct the code to fix the problem // =============> write your new code here @@ -36,8 +35,7 @@ console.log(`The last digit of 42 is ${getLastDigit(42)}`); console.log(`The last digit of 105 is ${getLastDigit(105)}`); console.log(`The last digit of 806 is ${getLastDigit(806)}`); - // This program should tell the user the last digit of each number. // Explain why getLastDigit is not working properly - correct the problem -// Because the function was using the global variable, it ignored the arguments passed to it outside of the function box +// Because the function was using the global variable, it ignored the arguments passed to it outside of the function box diff --git a/Sprint-3/3-mandatory-implement/1-bmi.js b/Sprint-3/3-mandatory-implement/1-bmi.js index 3156afcaa..3bde88c40 100644 --- a/Sprint-3/3-mandatory-implement/1-bmi.js +++ b/Sprint-3/3-mandatory-implement/1-bmi.js @@ -15,12 +15,10 @@ // It should return a string of their Body Mass Index to 1 decimal place function calculateBMI(weight, height) { - let BMI = weight / (height * height) - - return BMI.toFixed(1); + let BMI = weight / (height * height); - + return BMI.toFixed(1); } console.log(calculateBMI(62, 1.67)); -// return the BMI of someone based off their weight and height \ No newline at end of file +// return the BMI of someone based off their weight and height diff --git a/Sprint-3/3-mandatory-implement/2-cases.js b/Sprint-3/3-mandatory-implement/2-cases.js index 825e82582..738bdf228 100644 --- a/Sprint-3/3-mandatory-implement/2-cases.js +++ b/Sprint-3/3-mandatory-implement/2-cases.js @@ -16,8 +16,7 @@ // This might help https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase function toUpper(input) { - return input.replaceAll(" ", "_").toUpperCase(); - + return input.replaceAll(" ", "_").toUpperCase(); } console.log(toUpper("alpha and omega")); diff --git a/Sprint-3/3-mandatory-implement/3-to-pounds.js b/Sprint-3/3-mandatory-implement/3-to-pounds.js index 015428437..ee41cc557 100644 --- a/Sprint-3/3-mandatory-implement/3-to-pounds.js +++ b/Sprint-3/3-mandatory-implement/3-to-pounds.js @@ -5,30 +5,20 @@ // You should call this function a number of times to check it works for different inputs - - - - function toPounds(amount) { - const amountWithoutTrailingP = amount.substring( - 0, - amount.length - 1 -); + const amountWithoutTrailingP = amount.substring(0, amount.length - 1); -const paddedPenceNumberString = amountWithoutTrailingP.padStart(3, "0"); -const pounds = paddedPenceNumberString.substring( - 0, - paddedPenceNumberString.length - 2 -); + const paddedPenceNumberString = amountWithoutTrailingP.padStart(3, "0"); + const pounds = paddedPenceNumberString.substring( + 0, + paddedPenceNumberString.length - 2, + ); -const pence = paddedPenceNumberString - .substring(paddedPenceNumberString.length - 2) - .padEnd(2, "0"); + const pence = paddedPenceNumberString + .substring(paddedPenceNumberString.length - 2) + .padEnd(2, "0"); - return (`£${pounds}.${pence}`) + return `£${pounds}.${pence}`; } - console.log(toPounds("1250p")); - - diff --git a/Sprint-3/5-stretch-extend/format-time.js b/Sprint-3/5-stretch-extend/format-time.js index 32a32e66b..f86d01511 100644 --- a/Sprint-3/5-stretch-extend/format-time.js +++ b/Sprint-3/5-stretch-extend/format-time.js @@ -14,12 +14,12 @@ const currentOutput = formatAs12HourClock("08:00"); const targetOutput = "08:00 am"; console.assert( currentOutput === targetOutput, - `current output: ${currentOutput}, target output: ${targetOutput}` + `current output: ${currentOutput}, target output: ${targetOutput}`, ); const currentOutput2 = formatAs12HourClock("23:00"); const targetOutput2 = "11:00 pm"; console.assert( currentOutput2 === targetOutput2, - `current output: ${currentOutput2}, target output: ${targetOutput2}` + `current output: ${currentOutput2}, target output: ${targetOutput2}`, ); From 9a02929ffc97fc79c3ed302abf6e80abcfaf4e33 Mon Sep 17 00:00:00 2001 From: Frumentius-Rev Date: Fri, 25 Sep 2026 22:49:16 +0100 Subject: [PATCH 13/20] Update variable naming --- Sprint-3/1-key-errors/0.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sprint-3/1-key-errors/0.js b/Sprint-3/1-key-errors/0.js index 9c862b436..0c0a8242d 100644 --- a/Sprint-3/1-key-errors/0.js +++ b/Sprint-3/1-key-errors/0.js @@ -14,8 +14,8 @@ // If I give the new variable a different name, I hope it should work :) function capitalise(str) { - let newString = `${str[0].toUpperCase()}${str.slice(1)}`; - return newString; + let capitalisedString = `${str[0].toUpperCase()}${str.slice(1)}`; + return capitalisedString; } console.log(capitalise("frumentius")); From cf22a5119570fc4c0a4463a10fb7466d39dff6e5 Mon Sep 17 00:00:00 2001 From: Frumentius-Rev Date: Fri, 25 Sep 2026 23:03:12 +0100 Subject: [PATCH 14/20] Remove quotes from percentage --- Sprint-3/1-key-errors/1.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sprint-3/1-key-errors/1.js b/Sprint-3/1-key-errors/1.js index cb9c2a3f9..a88da573a 100644 --- a/Sprint-3/1-key-errors/1.js +++ b/Sprint-3/1-key-errors/1.js @@ -29,4 +29,4 @@ function convertToPercentage(decimalNumber) { return percentage; } -console.log(convertToPercentage("26")); +console.log(convertToPercentage(26)); From d9e2cde20a4781aea75c3332304269bedda07d56 Mon Sep 17 00:00:00 2001 From: Frumentius-Rev Date: Fri, 25 Sep 2026 23:09:47 +0100 Subject: [PATCH 15/20] Remove duplicated log --- Sprint-3/2-mandatory-debug/0.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sprint-3/2-mandatory-debug/0.js b/Sprint-3/2-mandatory-debug/0.js index 50956778d..7278cfab1 100644 --- a/Sprint-3/2-mandatory-debug/0.js +++ b/Sprint-3/2-mandatory-debug/0.js @@ -18,7 +18,7 @@ console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`); // =============> write your new code here function multiply(a, b) { - console.log(a * b); + return a * b; } console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`); From 365fc3aac9b1f0f121f237c57a0d27f85d48a2e7 Mon Sep 17 00:00:00 2001 From: Frumentius-Rev Date: Fri, 25 Sep 2026 23:51:16 +0100 Subject: [PATCH 16/20] Clarifing return value types --- Sprint-3/4-mandatory-interpret/time-format.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sprint-3/4-mandatory-interpret/time-format.js b/Sprint-3/4-mandatory-interpret/time-format.js index 4e775e407..a99388fa0 100644 --- a/Sprint-3/4-mandatory-interpret/time-format.js +++ b/Sprint-3/4-mandatory-interpret/time-format.js @@ -30,10 +30,10 @@ console.log(formatTimeDisplay(61)); // 0 // c) What is the return value of pad when it is called for the first time? -// 00 +// "00" // d) What is the value assigned to num when pad is called for the last time in this program? Explain your answer // 1 // e) What is the return value of pad when it is called for the last time in this program? Explain your answer -// 01 +// "01" From 0c6b70470f5c4fe1144b53fd8fc81aec7f9a6468 Mon Sep 17 00:00:00 2001 From: Frumentius-Rev Date: Mon, 28 Sep 2026 16:03:49 +0100 Subject: [PATCH 17/20] Update to uppersnamecase --- Sprint-3/3-mandatory-implement/2-cases.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sprint-3/3-mandatory-implement/2-cases.js b/Sprint-3/3-mandatory-implement/2-cases.js index 738bdf228..605ce8295 100644 --- a/Sprint-3/3-mandatory-implement/2-cases.js +++ b/Sprint-3/3-mandatory-implement/2-cases.js @@ -15,8 +15,8 @@ // Use the MDN string documentation to help you find a solution // This might help https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase -function toUpper(input) { +function toUpperSnakeCase(input) { return input.replaceAll(" ", "_").toUpperCase(); } -console.log(toUpper("alpha and omega")); +console.log(toUpperSnakeCase("alpha and omega")); From da302ee21812db5e3ca10522a7cdd3b1ceedf4ec Mon Sep 17 00:00:00 2001 From: Frumentius-Rev Date: Mon, 28 Sep 2026 16:14:30 +0100 Subject: [PATCH 18/20] Update Convert decimal to percentage --- Sprint-3/1-key-errors/1.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sprint-3/1-key-errors/1.js b/Sprint-3/1-key-errors/1.js index a88da573a..af93577c1 100644 --- a/Sprint-3/1-key-errors/1.js +++ b/Sprint-3/1-key-errors/1.js @@ -29,4 +29,4 @@ function convertToPercentage(decimalNumber) { return percentage; } -console.log(convertToPercentage(26)); +console.log(convertToPercentage(0.7)); From bc5bd0e35836ede601991011372cea6256dcc6fe Mon Sep 17 00:00:00 2001 From: Frumentius-Rev Date: Mon, 28 Sep 2026 16:18:46 +0100 Subject: [PATCH 19/20] Update add comments --- Sprint-3/2-mandatory-debug/0.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sprint-3/2-mandatory-debug/0.js b/Sprint-3/2-mandatory-debug/0.js index 7278cfab1..e2679cf2e 100644 --- a/Sprint-3/2-mandatory-debug/0.js +++ b/Sprint-3/2-mandatory-debug/0.js @@ -3,11 +3,11 @@ // =============> write your prediction here // I believe the function will calculate 10 x 32 -function multiply(a, b) { +/* function multiply(a, b) { console.log(a * b); } -console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`); +console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`); */ // =============> write your explanation here From 9723adba9e42ad149a267ed821c6499a04345c9d Mon Sep 17 00:00:00 2001 From: Frumentius-Rev Date: Mon, 28 Sep 2026 16:23:49 +0100 Subject: [PATCH 20/20] Remove unused const num --- Sprint-3/2-mandatory-debug/2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sprint-3/2-mandatory-debug/2.js b/Sprint-3/2-mandatory-debug/2.js index 6eed48426..b10031f3a 100644 --- a/Sprint-3/2-mandatory-debug/2.js +++ b/Sprint-3/2-mandatory-debug/2.js @@ -25,7 +25,7 @@ console.log(`The last digit of 806 is ${getLastDigit(806)}`); */ // Finally, correct the code to fix the problem // =============> write your new code here -const num = 103; + function getLastDigit(num) { return num.toString().slice(-1);