From d20c0a3eaaf516a4dfebc330b778e3ebbed5d2be Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Mon, 23 Feb 2026 22:23:56 +0000 Subject: [PATCH 01/68] describing what line 3 is doing (reassignment) Updated comment to clarify the assignment operation. --- Sprint-1/1-key-exercises/1-count.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sprint-1/1-key-exercises/1-count.js b/Sprint-1/1-key-exercises/1-count.js index 117bcb2b6e..7d4d50fe89 100644 --- a/Sprint-1/1-key-exercises/1-count.js +++ b/Sprint-1/1-key-exercises/1-count.js @@ -3,4 +3,4 @@ let count = 0; count = count + 1; // Line 1 is a variable declaration, creating the count variable with an initial value of 0 -// Describe what line 3 is doing, in particular focus on what = is doing +// the third line used the the assignment operator '=' to reassign the variable count to the initial value which is zero incremented by one resulting to the value 1 From 3428f4199b5a0b2de0dbed37f5838cec30142b28 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Tue, 24 Feb 2026 23:21:05 +0000 Subject: [PATCH 02/68] producing the string "CKJ" Updated the initials variable to dynamically generate initials from first, middle, and last names. --- Sprint-1/1-key-exercises/2-initials.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Sprint-1/1-key-exercises/2-initials.js b/Sprint-1/1-key-exercises/2-initials.js index 47561f6175..000e8e1cc3 100644 --- a/Sprint-1/1-key-exercises/2-initials.js +++ b/Sprint-1/1-key-exercises/2-initials.js @@ -5,7 +5,11 @@ let lastName = "Johnson"; // Declare a variable called initials that stores the first character of each string. // This should produce the string "CKJ", but you must not write the characters C, K, or J in the code of your solution. -let initials = ``; +let initials = firstName.charAt(0)+middleName.charAt(0)+lastName.charAt(0); +// or +let initials = firstName[0] + middleName[0] + lastName[0]; +// or but rarely used and not recommended because it might cause bugs +let initials = firstName[0].concat(middleName[0], lastName[0]); // https://www.google.com/search?q=get+first+character+of+string+mdn From 38427c240c47592e6dd708a07d115abc986f73d1 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Wed, 25 Feb 2026 15:39:07 +0000 Subject: [PATCH 03/68] creating variable to store specific part (slice) of string Implemented logic to extract directory and extension from filePath. --- Sprint-1/1-key-exercises/3-paths.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Sprint-1/1-key-exercises/3-paths.js b/Sprint-1/1-key-exercises/3-paths.js index ab90ebb28e..6d1c509e5a 100644 --- a/Sprint-1/1-key-exercises/3-paths.js +++ b/Sprint-1/1-key-exercises/3-paths.js @@ -17,7 +17,10 @@ console.log(`The base part of ${filePath} is ${base}`); // Create a variable to store the dir part of the filePath variable // Create a variable to store the ext part of the variable -const dir = ; -const ext = ; +const dir = filePath.slice(0,lastSlashIndex+1); +const ext = filePath.slice(-3); //the extention of the file is always the last three characters in the path +//or +const lastPointIndex = filePath.lastIndexOf("."); +const ext = filePath.slice(lastPointIndex+1); -// https://www.google.com/search?q=slice+mdn \ No newline at end of file +// https://www.google.com/search?q=slice+mdn From 2f3f08d109929057e3b48615d9a6f22a994b4736 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Wed, 25 Feb 2026 18:52:47 +0000 Subject: [PATCH 04/68] building an idea of what a program is doing Added comments to explain the purpose and behavior of the num variable and the random number generation process. --- Sprint-1/1-key-exercises/4-random.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Sprint-1/1-key-exercises/4-random.js b/Sprint-1/1-key-exercises/4-random.js index 292f83aabb..74b490d154 100644 --- a/Sprint-1/1-key-exercises/4-random.js +++ b/Sprint-1/1-key-exercises/4-random.js @@ -7,3 +7,14 @@ const num = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum; // Try breaking down the expression and using documentation to explain what it means // It will help to think about the order in which expressions are evaluated // Try logging the value of num and running the program several times to build an idea of what the program is doing + +// the num represents a value with limited interval and that's why +// the num assigned to a value that's in the dor of an expression +// the math object is invoked to perform some mathematical tasks +// the random method is invoked to get a random number between 0 and 1 +// the random number is multiplied by 100 +// the floor method is invoked to round down the result to its nearest integer +// added one to the new result +// the final result of the whole expression is what the variable num assigned to +/* after applying the program several times, I got the idea that the program is generating +a value to the num variable thats always between minimum an maximum*/ From 44271ba7b060f6ef262c88fae0a083fd97ae2547 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Wed, 25 Feb 2026 22:06:55 +0000 Subject: [PATCH 05/68] Convert instructions to comments --- Sprint-1/2-mandatory-errors/0.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Sprint-1/2-mandatory-errors/0.js b/Sprint-1/2-mandatory-errors/0.js index cf6c5039f7..59cd85d52e 100644 --- a/Sprint-1/2-mandatory-errors/0.js +++ b/Sprint-1/2-mandatory-errors/0.js @@ -1,2 +1,3 @@ -This is just an instruction for the first activity - but it is just for human consumption -We don't want the computer to run these 2 lines - how can we solve this problem? \ No newline at end of file +// This is just an instruction for the first activity - but it is just for human consumption +// We don't want the computer to run these 2 lines - how can we solve this problem? +// to make the computer not running these two line we use inline comments by adding two slashes at the beginning of each line From e0b32562ca045b8cad9c27ee6239553cd30703ac Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Wed, 25 Feb 2026 22:12:34 +0000 Subject: [PATCH 06/68] Use 'let' for age variable to enable reassignment Changed 'const' to 'let' for age variable to allow reassignment. --- Sprint-1/2-mandatory-errors/1.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sprint-1/2-mandatory-errors/1.js b/Sprint-1/2-mandatory-errors/1.js index 7a43cbea76..af5aad5c0d 100644 --- a/Sprint-1/2-mandatory-errors/1.js +++ b/Sprint-1/2-mandatory-errors/1.js @@ -1,4 +1,4 @@ // trying to create an age variable and then reassign the value by 1 -const age = 33; +let age = 33; // we should use the keyword 'let' to declare the variable 'age' to allow reassignment later age = age + 1; From 21914bb407a895b19e2de778edb292aead6b1778 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Wed, 25 Feb 2026 22:18:35 +0000 Subject: [PATCH 07/68] Correct variable declaration for cityOfBirth Fix variable declaration order to avoid reference error. --- Sprint-1/2-mandatory-errors/2.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sprint-1/2-mandatory-errors/2.js b/Sprint-1/2-mandatory-errors/2.js index e09b89831d..6fd12745cb 100644 --- a/Sprint-1/2-mandatory-errors/2.js +++ b/Sprint-1/2-mandatory-errors/2.js @@ -1,5 +1,7 @@ // Currently trying to print the string "I was born in Bolton" but it isn't working... // what's the error ? -console.log(`I was born in ${cityOfBirth}`); const cityOfBirth = "Bolton"; +console.log(`I was born in ${cityOfBirth}`); + +// the error is that the variable 'cityOfBirth' is declared after the statement it is used in From 17d93a63af0f07a5d89b1bbf927a826064e30249 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Wed, 25 Feb 2026 22:51:54 +0000 Subject: [PATCH 08/68] Fix the typeOf variable to be able to use a method Updated last4Digits assignment to convert cardNumber to a string before slicing. --- Sprint-1/2-mandatory-errors/3.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Sprint-1/2-mandatory-errors/3.js b/Sprint-1/2-mandatory-errors/3.js index ec101884db..91263c6a0a 100644 --- a/Sprint-1/2-mandatory-errors/3.js +++ b/Sprint-1/2-mandatory-errors/3.js @@ -1,5 +1,5 @@ const cardNumber = 4533787178994213; -const last4Digits = cardNumber.slice(-4); +const last4Digits = (cardNumber.toString()).slice(-4); // The last4Digits variable should store the last 4 digits of cardNumber // However, the code isn't working @@ -7,3 +7,12 @@ const last4Digits = cardNumber.slice(-4); // Then run the code and see what error it gives. // Consider: Why does it give this error? Is this what I predicted? If not, what's different? // Then try updating the expression last4Digits is assigned to, in order to get the correct value + +/* my prediction about why the code isn't working is because either the new variable is declared with const keyword +or the value of the variable cardNumber is a number not a string whereas the method .slice works only with strings */ +// the error it gives 'cardNumber.slice is not a function' +// It gives this error because the computer assumes the coder is trying to invoke a function +// yes it is my second prediction +// updating the expression last4Digits is assigned to, in order to get the correct value is as follows +// method one: puting the value of the variable cardNumber into quotes +// method two: invoking the method .toString() to convert the type of the variable from number to string From af481768bb66e3740dd8941427761eaa0a7985d8 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Wed, 25 Feb 2026 23:02:00 +0000 Subject: [PATCH 09/68] Rename clock time variables to valid identifiers Updated variable names to avoid starting with digits. --- Sprint-1/2-mandatory-errors/4.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Sprint-1/2-mandatory-errors/4.js b/Sprint-1/2-mandatory-errors/4.js index 21dad8c5d1..d78326fc3e 100644 --- a/Sprint-1/2-mandatory-errors/4.js +++ b/Sprint-1/2-mandatory-errors/4.js @@ -1,2 +1,6 @@ -const 12HourClockTime = "20:53"; -const 24hourClockTime = "08:53"; \ No newline at end of file +const _12HourClockTime = "20:53"; // identifier can not begin with a number +// or +const $12HourClockTime = "20:53"; // or any change that makes the identifier not stating with digit +const _24hourClockTime = "08:53"; // identifier can not begin with a number +// or +const $24hourClockTime = "08:53"; // or any change that makes the identifier not stating with digit From 4ba270e254bce4b12a7dd8353cbb0035d7c89b4a Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Thu, 26 Feb 2026 23:15:14 +0000 Subject: [PATCH 10/68] Fix syntax error in priceAfterOneYear assignment Fixed syntax error in priceAfterOneYear assignment and updated comments. --- .../3-mandatory-interpret/1-percentage-change.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Sprint-1/3-mandatory-interpret/1-percentage-change.js b/Sprint-1/3-mandatory-interpret/1-percentage-change.js index e24ecb8e18..73b30a9ea4 100644 --- a/Sprint-1/3-mandatory-interpret/1-percentage-change.js +++ b/Sprint-1/3-mandatory-interpret/1-percentage-change.js @@ -2,7 +2,7 @@ let carPrice = "10,000"; let priceAfterOneYear = "8,543"; carPrice = Number(carPrice.replaceAll(",", "")); -priceAfterOneYear = Number(priceAfterOneYear.replaceAll("," "")); +priceAfterOneYear = Number(priceAfterOneYear.replaceAll(",", "")); const priceDifference = carPrice - priceAfterOneYear; const percentageChange = (priceDifference / carPrice) * 100; @@ -12,11 +12,24 @@ console.log(`The percentage change is ${percentageChange}`); // Read the code and then answer the questions below // a) How many function calls are there in this file? Write down all the lines where a function call is made +// there are five function calls in this file, the lines where a call function is made are as follows: +// line 4, replaceAll() +// line 4, Number() +// line 5, replaceAll() +// line 5, Number() +// line 10, console.log() // b) Run the code and identify the line where the error is coming from - why is this error occurring? How can you fix this problem? +// the error is coming from line 5 +// it is a syntax error, the expression priceAfterOneYear.replaceAll("," "") ismissing a comma +// to fix this problem we add comma between the two arguments // c) Identify all the lines that are variable reassignment statements +// the lines that are variable reassignment statements: -line 4 -line 5 // d) Identify all the lines that are variable declarations +// the lines that are variable declarations: -line 1 -line 2 -line 7 -line 8 // e) Describe what the expression Number(carPrice.replaceAll(",","")) is doing - what is the purpose of this expression? +// the expression calls the replace method to replace the comma with empty string +// converting the new string to a number to be able to perform math operations From 67c8968cf8c1f491eede4492285bd36d185a0ad0 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Thu, 26 Feb 2026 23:56:42 +0000 Subject: [PATCH 11/68] generating time format for duration of a movie --- Sprint-1/3-mandatory-interpret/2-time-format.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Sprint-1/3-mandatory-interpret/2-time-format.js b/Sprint-1/3-mandatory-interpret/2-time-format.js index 47d2395587..e2dcfae0ce 100644 --- a/Sprint-1/3-mandatory-interpret/2-time-format.js +++ b/Sprint-1/3-mandatory-interpret/2-time-format.js @@ -12,14 +12,21 @@ console.log(result); // For the piece of code above, read the code and then answer the following questions // a) How many variable declarations are there in this program? +// there are 6 variable declaration // b) How many function calls are there? +// there is one function call (console.log()) // c) Using documentation, explain what the expression movieLength % 60 represents +// it represents the remaining of dividing movielength by 60 // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators // d) Interpret line 4, what does the expression assigned to totalMinutes mean? +// it means the integer quotient of dividing movieLength by 60 // e) What do you think the variable result represents? Can you think of a better name for this variable? +// it represents the length of the movie in hours, minutes and seconds format +// a better name would be: movieTimeVolume // f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer +// no it will not work for negative input values as it gives negative results From b72751f496440c69e9275a957d26afe2af82de00 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Fri, 27 Feb 2026 15:22:01 +0000 Subject: [PATCH 12/68] describing the purpose behind each step of the code Added comments to explain the purpose of each step in the code. --- Sprint-1/3-mandatory-interpret/3-to-pounds.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Sprint-1/3-mandatory-interpret/3-to-pounds.js b/Sprint-1/3-mandatory-interpret/3-to-pounds.js index 60c9ace69a..ddb4b40a4d 100644 --- a/Sprint-1/3-mandatory-interpret/3-to-pounds.js +++ b/Sprint-1/3-mandatory-interpret/3-to-pounds.js @@ -25,3 +25,8 @@ console.log(`£${pounds}.${pence}`); // To begin, we can start with // 1. const penceString = "399p": initialises a string variable with the value "399p" +// line 3: calling substring method to remove the 'p' letter and keep only digits in the string +// line 8: using padstart method to make the minimum length of the string to 3 characters by adding one zero or two to the left. +// line 9: using substring method to take only the integer part +// line 14: using substring method to take only the decimal part and padend method to make the minimum length of pence to 2 characters by adding zero to the right +// line 18: calling console function to print the integer part that represents the pound and the decimal part that represents the pence seprated by point From 35fdc82b33b2cd71659161ad72ece8c01e54cf55 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Fri, 27 Feb 2026 22:34:27 +0000 Subject: [PATCH 13/68] Fix variable redeclaration in a function Updated the capitalise function to fix variable redeclaration and corrected the return variable name. --- Sprint-2/1-key-errors/0.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Sprint-2/1-key-errors/0.js b/Sprint-2/1-key-errors/0.js index 653d6f5a07..26eec1a581 100644 --- a/Sprint-2/1-key-errors/0.js +++ b/Sprint-2/1-key-errors/0.js @@ -1,5 +1,5 @@ // Predict and explain first... -// =============> write your prediction here +// =============> the function is not going to work because a variable is declared twice (str) // call the function capitalise with a string input // interpret the error message and figure out why an error is occurring @@ -9,5 +9,10 @@ function capitalise(str) { return str; } -// =============> write your explanation here -// =============> write your new code here +// =============> the error message 'Identifier 'str' has already been declared', diplays because the toUpperCase function does not change the value of the varible declared +// but it creates a new one. +// =============> my new code: +function capitalise(str) { + result = `${str[0].toUpperCase()}${str.slice(1)}`; + return resault; +} From 4fdfb0707d0ae38a1cef926a9668fff91f466c47 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Fri, 27 Feb 2026 22:38:27 +0000 Subject: [PATCH 14/68] declaraing the variable 'result' in capitalise function Declare 'result' with 'let' to avoid redeclaration error. --- Sprint-2/1-key-errors/0.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sprint-2/1-key-errors/0.js b/Sprint-2/1-key-errors/0.js index 26eec1a581..39666b0606 100644 --- a/Sprint-2/1-key-errors/0.js +++ b/Sprint-2/1-key-errors/0.js @@ -13,6 +13,6 @@ function capitalise(str) { // but it creates a new one. // =============> my new code: function capitalise(str) { - result = `${str[0].toUpperCase()}${str.slice(1)}`; + let result = `${str[0].toUpperCase()}${str.slice(1)}`; return resault; } From d100737073f2f48036d5eccaf331b3e7321c218c Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Fri, 27 Feb 2026 22:51:51 +0000 Subject: [PATCH 15/68] Fix duplicate variable declaration and assigning in convertToPercentage function Removed duplicate declaration of decimalNumber and updated comments. --- Sprint-2/1-key-errors/1.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Sprint-2/1-key-errors/1.js b/Sprint-2/1-key-errors/1.js index f2d56151f4..cb2870c5f3 100644 --- a/Sprint-2/1-key-errors/1.js +++ b/Sprint-2/1-key-errors/1.js @@ -1,7 +1,8 @@ // Predict and explain first... // Why will an error occur when this program runs? -// =============> write your prediction here +// =============> because first: the variable decimalNumber is declared twice +// second: the parameter decimalNumber is assigned to a value inside the function // Try playing computer with the example to work out what is going on @@ -14,7 +15,13 @@ function convertToPercentage(decimalNumber) { console.log(decimalNumber); -// =============> write your explanation here +// =============> Identifier 'decimalNumber' has already been declared is the error msg thrown by the code // Finally, correct the code to fix the problem -// =============> write your new code here +// =============> +function convertToPercentage(decimalNumber) { +// const decimalNumber = 0.5; this line must be deleted + const percentage = `${decimalNumber * 100}%`; + + return percentage; +} From 3bcd5ba7f028cd57a445df6af8e4684f3b778d73 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Fri, 27 Feb 2026 23:02:42 +0000 Subject: [PATCH 16/68] Fix square function parameter Corrected the square function to properly accept a parameter and return its square. --- Sprint-2/1-key-errors/2.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Sprint-2/1-key-errors/2.js b/Sprint-2/1-key-errors/2.js index aad57f7cfe..25eb01a122 100644 --- a/Sprint-2/1-key-errors/2.js +++ b/Sprint-2/1-key-errors/2.js @@ -3,18 +3,22 @@ // this function should square any number but instead we're going to get an error -// =============> write your prediction of the error here +// =============> identifier not declared (unknown) function square(3) { return num * num; } -// =============> write the error message here +// =============> Unexpected number -// =============> explain this error message here +// =============> the parameter shouldn't be given an argument in the function definition // Finally, correct the code to fix the problem -// =============> write your new code here +// =============> my new code +function square(num) { + return num * num; +} +console.log(square(3)); From 5809aeec54cfeae9d2cd763b7f590d7566076987 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Fri, 27 Feb 2026 23:48:00 +0000 Subject: [PATCH 17/68] Fix multiply function to return result and log output Refactored multiply function to include return statement and improved logging. --- Sprint-2/2-mandatory-debug/0.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/Sprint-2/2-mandatory-debug/0.js b/Sprint-2/2-mandatory-debug/0.js index b27511b417..bd32b29c01 100644 --- a/Sprint-2/2-mandatory-debug/0.js +++ b/Sprint-2/2-mandatory-debug/0.js @@ -1,6 +1,6 @@ // Predict and explain first... -// =============> write your prediction here +// =============> the function when called will throw an error function multiply(a, b) { console.log(a * b); @@ -8,7 +8,19 @@ function multiply(a, b) { console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`); -// =============> write your explanation here +// =============> the function multiply has no return statement // Finally, correct the code to fix the problem -// =============> write your new code here +// =============> +function multiply(a, b) { + return (a * b); // we change the console.log statement with the return statement +} + +console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`); + +// an extra notice: the purpose of creating a function is to reuse it when needed +// I've noticed that the parameters are already assigned to values 10 and 32, so I changed the code to the following: +function multiply(a, b) { + return console.log(`The result of multiplying ` + a +` and ` + b +` is ` + (a * b)); +} +multiply(10, 32); From eee4034ac0c72706dce804eb8d88fe59323e5184 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Fri, 27 Feb 2026 23:56:06 +0000 Subject: [PATCH 18/68] Correct sum function to return the sum of arguments Fix the sum function to correctly return the sum of two numbers. --- Sprint-2/2-mandatory-debug/1.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Sprint-2/2-mandatory-debug/1.js b/Sprint-2/2-mandatory-debug/1.js index 37cedfbcfd..25d013be0d 100644 --- a/Sprint-2/2-mandatory-debug/1.js +++ b/Sprint-2/2-mandatory-debug/1.js @@ -1,5 +1,5 @@ // Predict and explain first... -// =============> write your prediction here +// =============> The sum of 10 and 32 is undefined function sum(a, b) { return; @@ -8,6 +8,13 @@ function sum(a, b) { console.log(`The sum of 10 and 32 is ${sum(10, 32)}`); -// =============> write your explanation here +// =============> the function sum returns Nul because it's straight followed by semicolon thate ends the statement +// also the statement a + b is in new line // Finally, correct the code to fix the problem -// =============> write your new code here +// =============> my new code +function sum(a, b) { + return a + b; +} + +console.log(`The sum of 10 and 32 is ${sum(10, 32)}`); + From db4474820eeca48ceda366735b43fe8e12ee1a04 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Sat, 28 Feb 2026 00:09:47 +0000 Subject: [PATCH 19/68] Fix getLastDigit function to return correct last digit Corrected the getLastDigit function to accept a parameter and return the last digit of a number. --- Sprint-2/2-mandatory-debug/2.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/Sprint-2/2-mandatory-debug/2.js b/Sprint-2/2-mandatory-debug/2.js index 57d3f5dc35..9e0d7acd09 100644 --- a/Sprint-2/2-mandatory-debug/2.js +++ b/Sprint-2/2-mandatory-debug/2.js @@ -1,7 +1,10 @@ // Predict and explain first... // Predict the output of the following code: -// =============> Write your prediction here +// =============> +// The last digit of 42 is 3 +// The last digit of 105 is 3 +// The last digit of 806 is 3 const num = 103; @@ -14,11 +17,20 @@ console.log(`The last digit of 105 is ${getLastDigit(105)}`); 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 last digit of 42 is 3 +// The last digit of 105 is 3 +// The last digit of 806 is 3 // Explain why the output is the way it is -// =============> write your explanation here +// =============> the variable num is assigned to the value 103 in the global scope and not assigned to any value in the function scope // Finally, correct the code to fix the problem // =============> write your new code here +function getLastDigit(num) { // we add the identier num as parameter to the function getLastDigit + 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 From 429f649a39b387f39e43da77bc74e7ba9d5c668b Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Sun, 1 Mar 2026 15:57:19 +0000 Subject: [PATCH 20/68] Implement upperSnakeCase function Added a function to convert a string to upper snake case. --- Sprint-2/3-mandatory-implement/2-cases.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Sprint-2/3-mandatory-implement/2-cases.js b/Sprint-2/3-mandatory-implement/2-cases.js index 5b0ef77ad9..994aa4b5d3 100644 --- a/Sprint-2/3-mandatory-implement/2-cases.js +++ b/Sprint-2/3-mandatory-implement/2-cases.js @@ -14,3 +14,9 @@ // 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 upperSnakeCase(wordsSet) { + let wsSnakeCase = wordsSet.replaceAll(' ','_'); + let wsupperSnakeCase = wsSnakeCase.toUpperCase(); + return console.log(wsupperSnakeCase); +} +upperSnakeCase('i do not know'); // evaluates to: "I_DO_NOT_KNOW" From 92bd8ef8afa349e4cb4d0c99b88c687bd8a840b7 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Sun, 1 Mar 2026 16:09:22 +0000 Subject: [PATCH 21/68] Implement toPounds function --- Sprint-2/3-mandatory-implement/3-to-pounds.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Sprint-2/3-mandatory-implement/3-to-pounds.js b/Sprint-2/3-mandatory-implement/3-to-pounds.js index 6265a1a703..656792454b 100644 --- a/Sprint-2/3-mandatory-implement/3-to-pounds.js +++ b/Sprint-2/3-mandatory-implement/3-to-pounds.js @@ -4,3 +4,16 @@ // 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(penceString) { + +const penceStringWithoutTrailingP = penceString.substring(0,penceString.length - 1); + +const paddedPenceNumberString = penceStringWithoutTrailingP.padStart(3, "0"); +const pounds = paddedPenceNumberString.substring(0,paddedPenceNumberString.length - 2); + +const pence = paddedPenceNumberString.substring(paddedPenceNumberString.length - 2).padEnd(2, "0"); + +return console.log(`£${pounds}.${pence}`); +} +toPounds('399p') // £3.99 +toPounds('1095p') // £10.95 From 56b74d5f822563c2bf7600d712a49a7ecc154b99 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Sun, 1 Mar 2026 19:02:33 +0000 Subject: [PATCH 22/68] Clarify pad function behavior in comments Updated comments in time-format.js to clarify the behavior of the pad function. --- Sprint-2/4-mandatory-interpret/time-format.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/Sprint-2/4-mandatory-interpret/time-format.js b/Sprint-2/4-mandatory-interpret/time-format.js index 7c98eb0e8c..a5facbec84 100644 --- a/Sprint-2/4-mandatory-interpret/time-format.js +++ b/Sprint-2/4-mandatory-interpret/time-format.js @@ -17,18 +17,27 @@ function formatTimeDisplay(seconds) { // Questions // a) When formatTimeDisplay is called how many times will pad be called? -// =============> write your answer here +// =============> pad will be called 3 times // 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 +// =============> the value assigned to num is 0 // c) What is the return value of pad is called for the first time? -// =============> write your answer here +// =============> the return value of pad is called for the first time is "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 +// =============> the value assigned to num is 1 +// because the last time pad is called for the remainingSeconds holding the value 1 +// return pad(remainingSeconds) +// function pad(1){ // e) What is the return value assigned to num when pad is called for the last time in this program? Explain your answer -// =============> write your answer here +// =============> the return value of pad is called for the last time is "01" +// because the argument passed to the pad parameter is the value of the remainingSeconds wich is 1 +// function pad(1){ +// return 1.toString().padStart(2, "0"); +// return "1".pad(2,"0"); +// return "01" +//} From 5196c63e432fb64607e334dd9dfcedff1d734275 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Sun, 1 Mar 2026 19:08:29 +0000 Subject: [PATCH 23/68] Clean up comments in time-format.js Removed comments with answers to questions about the pad function. --- Sprint-2/4-mandatory-interpret/time-format.js | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/Sprint-2/4-mandatory-interpret/time-format.js b/Sprint-2/4-mandatory-interpret/time-format.js index a5facbec84..f24c426fb4 100644 --- a/Sprint-2/4-mandatory-interpret/time-format.js +++ b/Sprint-2/4-mandatory-interpret/time-format.js @@ -17,27 +17,18 @@ function formatTimeDisplay(seconds) { // Questions // a) When formatTimeDisplay is called how many times will pad be called? -// =============> pad will be called 3 times + // 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? -// =============> the value assigned to num is 0 +// =============> write your answer here // c) What is the return value of pad is called for the first time? -// =============> the return value of pad is called for the first time is "00" +// =============> write your answer here // d) What is the value assigned to num when pad is called for the last time in this program? Explain your answer -// =============> the value assigned to num is 1 -// because the last time pad is called for the remainingSeconds holding the value 1 -// return pad(remainingSeconds) -// function pad(1){ +// =============> write your answer here // e) What is the return value assigned to num when pad is called for the last time in this program? Explain your answer -// =============> the return value of pad is called for the last time is "01" -// because the argument passed to the pad parameter is the value of the remainingSeconds wich is 1 -// function pad(1){ -// return 1.toString().padStart(2, "0"); -// return "1".pad(2,"0"); -// return "01" -//} +// =============> write your answer here From 122c731ad28403032be415e96b875edccfb0640f Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Sun, 1 Mar 2026 22:15:01 +0000 Subject: [PATCH 24/68] Refactor toPounds function Refactor toPounds function for reusability and clarity. --- Sprint-2/3-mandatory-implement/3-to-pounds.js | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/Sprint-2/3-mandatory-implement/3-to-pounds.js b/Sprint-2/3-mandatory-implement/3-to-pounds.js index 656792454b..6265a1a703 100644 --- a/Sprint-2/3-mandatory-implement/3-to-pounds.js +++ b/Sprint-2/3-mandatory-implement/3-to-pounds.js @@ -4,16 +4,3 @@ // 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(penceString) { - -const penceStringWithoutTrailingP = penceString.substring(0,penceString.length - 1); - -const paddedPenceNumberString = penceStringWithoutTrailingP.padStart(3, "0"); -const pounds = paddedPenceNumberString.substring(0,paddedPenceNumberString.length - 2); - -const pence = paddedPenceNumberString.substring(paddedPenceNumberString.length - 2).padEnd(2, "0"); - -return console.log(`£${pounds}.${pence}`); -} -toPounds('399p') // £3.99 -toPounds('1095p') // £10.95 From 7d09f40e315ffe84147e63ce9dc0f5ba7cba979e Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Sun, 1 Mar 2026 22:20:30 +0000 Subject: [PATCH 25/68] Remove upperSnakeCase function restore the file to the main version Removed the upperSnakeCase function implementation and example call. --- Sprint-2/3-mandatory-implement/2-cases.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Sprint-2/3-mandatory-implement/2-cases.js b/Sprint-2/3-mandatory-implement/2-cases.js index 994aa4b5d3..5b0ef77ad9 100644 --- a/Sprint-2/3-mandatory-implement/2-cases.js +++ b/Sprint-2/3-mandatory-implement/2-cases.js @@ -14,9 +14,3 @@ // 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 upperSnakeCase(wordsSet) { - let wsSnakeCase = wordsSet.replaceAll(' ','_'); - let wsupperSnakeCase = wsSnakeCase.toUpperCase(); - return console.log(wsupperSnakeCase); -} -upperSnakeCase('i do not know'); // evaluates to: "I_DO_NOT_KNOW" From 7b87fbc5bbd98c0be4b11fc25882e06c08f409be Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Sun, 1 Mar 2026 22:27:55 +0000 Subject: [PATCH 26/68] Update 2.js --- Sprint-2/2-mandatory-debug/2.js | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/Sprint-2/2-mandatory-debug/2.js b/Sprint-2/2-mandatory-debug/2.js index 9e0d7acd09..57d3f5dc35 100644 --- a/Sprint-2/2-mandatory-debug/2.js +++ b/Sprint-2/2-mandatory-debug/2.js @@ -1,10 +1,7 @@ // Predict and explain first... // Predict the output of the following code: -// =============> -// The last digit of 42 is 3 -// The last digit of 105 is 3 -// The last digit of 806 is 3 +// =============> Write your prediction here const num = 103; @@ -17,20 +14,11 @@ console.log(`The last digit of 105 is ${getLastDigit(105)}`); console.log(`The last digit of 806 is ${getLastDigit(806)}`); // Now run the code and compare the output to your prediction -// =============>// The last digit of 42 is 3 -// The last digit of 105 is 3 -// The last digit of 806 is 3 +// =============> write the output here // Explain why the output is the way it is -// =============> the variable num is assigned to the value 103 in the global scope and not assigned to any value in the function scope +// =============> write your explanation here // Finally, correct the code to fix the problem // =============> write your new code here -function getLastDigit(num) { // we add the identier num as parameter to the function getLastDigit - 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 From 652dbc11025329259f780f3b067730a066456263 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Sun, 1 Mar 2026 22:31:23 +0000 Subject: [PATCH 27/68] Update 1.js Fix the sum function to return the correct result. --- Sprint-2/2-mandatory-debug/1.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/Sprint-2/2-mandatory-debug/1.js b/Sprint-2/2-mandatory-debug/1.js index 25d013be0d..37cedfbcfd 100644 --- a/Sprint-2/2-mandatory-debug/1.js +++ b/Sprint-2/2-mandatory-debug/1.js @@ -1,5 +1,5 @@ // Predict and explain first... -// =============> The sum of 10 and 32 is undefined +// =============> write your prediction here function sum(a, b) { return; @@ -8,13 +8,6 @@ function sum(a, b) { console.log(`The sum of 10 and 32 is ${sum(10, 32)}`); -// =============> the function sum returns Nul because it's straight followed by semicolon thate ends the statement -// also the statement a + b is in new line +// =============> write your explanation here // Finally, correct the code to fix the problem -// =============> my new code -function sum(a, b) { - return a + b; -} - -console.log(`The sum of 10 and 32 is ${sum(10, 32)}`); - +// =============> write your new code here From bbdcc95453a99e5c11041e9dd0ad2580d9fc22ab Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Sun, 1 Mar 2026 22:33:46 +0000 Subject: [PATCH 28/68] Update 2.js Corrected the square function to properly accept a parameter and return its square. --- Sprint-2/1-key-errors/2.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/Sprint-2/1-key-errors/2.js b/Sprint-2/1-key-errors/2.js index 25eb01a122..09ecc04999 100644 --- a/Sprint-2/1-key-errors/2.js +++ b/Sprint-2/1-key-errors/2.js @@ -3,22 +3,16 @@ // this function should square any number but instead we're going to get an error -// =============> identifier not declared (unknown) +// =============> write your prediction of the error here function square(3) { return num * num; } -// =============> Unexpected number +// =============> write the error message here -// =============> the parameter shouldn't be given an argument in the function definition +// =============> explain this error message here // Finally, correct the code to fix the problem -// =============> my new code -function square(num) { - return num * num; -} -console.log(square(3)); - - +// =============> write your new code here From 177c3687417cddee17598ee568401742d626ac47 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Sun, 1 Mar 2026 22:36:10 +0000 Subject: [PATCH 29/68] Update 1.js Updated comments to clarify errors and provide explanations. --- Sprint-2/1-key-errors/1.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/Sprint-2/1-key-errors/1.js b/Sprint-2/1-key-errors/1.js index cb2870c5f3..f2d56151f4 100644 --- a/Sprint-2/1-key-errors/1.js +++ b/Sprint-2/1-key-errors/1.js @@ -1,8 +1,7 @@ // Predict and explain first... // Why will an error occur when this program runs? -// =============> because first: the variable decimalNumber is declared twice -// second: the parameter decimalNumber is assigned to a value inside the function +// =============> write your prediction here // Try playing computer with the example to work out what is going on @@ -15,13 +14,7 @@ function convertToPercentage(decimalNumber) { console.log(decimalNumber); -// =============> Identifier 'decimalNumber' has already been declared is the error msg thrown by the code +// =============> write your explanation here // Finally, correct the code to fix the problem -// =============> -function convertToPercentage(decimalNumber) { -// const decimalNumber = 0.5; this line must be deleted - const percentage = `${decimalNumber * 100}%`; - - return percentage; -} +// =============> write your new code here From 3bb9ddf441cce7888063f86247f2cf6e8a9ba323 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Sun, 1 Mar 2026 22:47:26 +0000 Subject: [PATCH 30/68] Update 0.js Removed duplicate variable declaration and fixed typo in return statement. --- Sprint-2/1-key-errors/0.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Sprint-2/1-key-errors/0.js b/Sprint-2/1-key-errors/0.js index 39666b0606..653d6f5a07 100644 --- a/Sprint-2/1-key-errors/0.js +++ b/Sprint-2/1-key-errors/0.js @@ -1,5 +1,5 @@ // Predict and explain first... -// =============> the function is not going to work because a variable is declared twice (str) +// =============> write your prediction here // call the function capitalise with a string input // interpret the error message and figure out why an error is occurring @@ -9,10 +9,5 @@ function capitalise(str) { return str; } -// =============> the error message 'Identifier 'str' has already been declared', diplays because the toUpperCase function does not change the value of the varible declared -// but it creates a new one. -// =============> my new code: -function capitalise(str) { - let result = `${str[0].toUpperCase()}${str.slice(1)}`; - return resault; -} +// =============> write your explanation here +// =============> write your new code here From fcb6413f2963d95fe9f56618f8a2f9e875cc8afb Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Sat, 7 Mar 2026 16:02:51 +0000 Subject: [PATCH 31/68] formatting using prettier --- Module-Structuring-and-Testing-Data | 1 + Sprint-1/1-key-exercises/1-count.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 160000 Module-Structuring-and-Testing-Data diff --git a/Module-Structuring-and-Testing-Data b/Module-Structuring-and-Testing-Data new file mode 160000 index 0000000000..3bb9ddf441 --- /dev/null +++ b/Module-Structuring-and-Testing-Data @@ -0,0 +1 @@ +Subproject commit 3bb9ddf441cce7888063f86247f2cf6e8a9ba323 diff --git a/Sprint-1/1-key-exercises/1-count.js b/Sprint-1/1-key-exercises/1-count.js index 7d4d50fe89..c7f82290cf 100644 --- a/Sprint-1/1-key-exercises/1-count.js +++ b/Sprint-1/1-key-exercises/1-count.js @@ -3,4 +3,4 @@ let count = 0; count = count + 1; // Line 1 is a variable declaration, creating the count variable with an initial value of 0 -// the third line used the the assignment operator '=' to reassign the variable count to the initial value which is zero incremented by one resulting to the value 1 +// the third line used the assignment operator '=' to reassign the variable count to the initial value which is zero incremented by one resulting to the value 1 From 2292f321316820c1cf4a1b7f60547726b9ac9413 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Sat, 7 Mar 2026 16:08:07 +0000 Subject: [PATCH 32/68] formatting using prettier --- Sprint-1/1-key-exercises/2-initials.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Sprint-1/1-key-exercises/2-initials.js b/Sprint-1/1-key-exercises/2-initials.js index 000e8e1cc3..8fc5721b30 100644 --- a/Sprint-1/1-key-exercises/2-initials.js +++ b/Sprint-1/1-key-exercises/2-initials.js @@ -5,11 +5,10 @@ let lastName = "Johnson"; // Declare a variable called initials that stores the first character of each string. // This should produce the string "CKJ", but you must not write the characters C, K, or J in the code of your solution. -let initials = firstName.charAt(0)+middleName.charAt(0)+lastName.charAt(0); +let initials = firstName.charAt(0) + middleName.charAt(0) + lastName.charAt(0); // or -let initials = firstName[0] + middleName[0] + lastName[0]; +//let initials = firstName[0] + middleName[0] + lastName[0]; // or but rarely used and not recommended because it might cause bugs -let initials = firstName[0].concat(middleName[0], lastName[0]); +//let initials = firstName[0].concat(middleName[0], lastName[0]); // https://www.google.com/search?q=get+first+character+of+string+mdn - From f92ac8052504137f6f238953f69928102e6dc9be Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Sat, 7 Mar 2026 16:12:11 +0000 Subject: [PATCH 33/68] formatting using prettier --- Sprint-1/1-key-exercises/3-paths.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sprint-1/1-key-exercises/3-paths.js b/Sprint-1/1-key-exercises/3-paths.js index 6d1c509e5a..d2be3abade 100644 --- a/Sprint-1/1-key-exercises/3-paths.js +++ b/Sprint-1/1-key-exercises/3-paths.js @@ -17,10 +17,10 @@ console.log(`The base part of ${filePath} is ${base}`); // Create a variable to store the dir part of the filePath variable // Create a variable to store the ext part of the variable -const dir = filePath.slice(0,lastSlashIndex+1); +const dir = filePath.slice(0, lastSlashIndex + 1); const ext = filePath.slice(-3); //the extention of the file is always the last three characters in the path //or -const lastPointIndex = filePath.lastIndexOf("."); -const ext = filePath.slice(lastPointIndex+1); +//const lastPointIndex = filePath.lastIndexOf("."); +//const ext = filePath.slice(lastPointIndex+1); // https://www.google.com/search?q=slice+mdn From 10386dd9a92cc62c72634e283c84f66432cd1be4 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Sat, 7 Mar 2026 16:15:46 +0000 Subject: [PATCH 34/68] formatting using prettier --- Sprint-1/1-key-exercises/4-random.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sprint-1/1-key-exercises/4-random.js b/Sprint-1/1-key-exercises/4-random.js index 74b490d154..4abba35cab 100644 --- a/Sprint-1/1-key-exercises/4-random.js +++ b/Sprint-1/1-key-exercises/4-random.js @@ -12,9 +12,9 @@ const num = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum; // the num assigned to a value that's in the dor of an expression // the math object is invoked to perform some mathematical tasks // the random method is invoked to get a random number between 0 and 1 -// the random number is multiplied by 100 +// the random number is multiplied by 100 // the floor method is invoked to round down the result to its nearest integer // added one to the new result // the final result of the whole expression is what the variable num assigned to /* after applying the program several times, I got the idea that the program is generating -a value to the num variable thats always between minimum an maximum*/ +a value to the num variable thats always between minimum an maximum*/ From b3b93d6eb577d38611a4d2751769f7996b4446ab Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Sat, 7 Mar 2026 16:22:14 +0000 Subject: [PATCH 35/68] formatting using prettier --- Sprint-1/2-mandatory-errors/1.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sprint-1/2-mandatory-errors/1.js b/Sprint-1/2-mandatory-errors/1.js index af5aad5c0d..8cee2d84ad 100644 --- a/Sprint-1/2-mandatory-errors/1.js +++ b/Sprint-1/2-mandatory-errors/1.js @@ -1,4 +1,4 @@ // trying to create an age variable and then reassign the value by 1 -let age = 33; // we should use the keyword 'let' to declare the variable 'age' to allow reassignment later +let age = 33; // we should use the keyword 'let' to declare the variable 'age' to allow reassignment later age = age + 1; From 3438d6e6304a24cde4d4b6d9591949018e34e6ec Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Sat, 7 Mar 2026 16:23:08 +0000 Subject: [PATCH 36/68] formatting using prettier --- Module-Structuring-and-Testing-Data | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Module-Structuring-and-Testing-Data b/Module-Structuring-and-Testing-Data index 3bb9ddf441..b3b93d6eb5 160000 --- a/Module-Structuring-and-Testing-Data +++ b/Module-Structuring-and-Testing-Data @@ -1 +1 @@ -Subproject commit 3bb9ddf441cce7888063f86247f2cf6e8a9ba323 +Subproject commit b3b93d6eb577d38611a4d2751769f7996b4446ab From 3f4904ac26b8ebddbf28404506da1bf1f99244e7 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Sat, 7 Mar 2026 16:35:26 +0000 Subject: [PATCH 37/68] formatting using prettier --- Module-Structuring-and-Testing-Data | 1 - 1 file changed, 1 deletion(-) delete mode 160000 Module-Structuring-and-Testing-Data diff --git a/Module-Structuring-and-Testing-Data b/Module-Structuring-and-Testing-Data deleted file mode 160000 index b3b93d6eb5..0000000000 --- a/Module-Structuring-and-Testing-Data +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b3b93d6eb577d38611a4d2751769f7996b4446ab From 8b934c0085fb2c5b0f339baa1ded7834c8cebbe0 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Sat, 7 Mar 2026 16:50:40 +0000 Subject: [PATCH 38/68] formatting using prettier --- Sprint-1/2-mandatory-errors/3.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sprint-1/2-mandatory-errors/3.js b/Sprint-1/2-mandatory-errors/3.js index 91263c6a0a..3a98600618 100644 --- a/Sprint-1/2-mandatory-errors/3.js +++ b/Sprint-1/2-mandatory-errors/3.js @@ -1,5 +1,5 @@ const cardNumber = 4533787178994213; -const last4Digits = (cardNumber.toString()).slice(-4); +const last4Digits = cardNumber.toString().slice(-4); // The last4Digits variable should store the last 4 digits of cardNumber // However, the code isn't working From c4c751f330a450df8d2dc1b43b1e3fc21b9e6db0 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Sat, 7 Mar 2026 16:53:58 +0000 Subject: [PATCH 39/68] formatting using prettier and removing suggestion --- Sprint-1/2-mandatory-errors/4.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Sprint-1/2-mandatory-errors/4.js b/Sprint-1/2-mandatory-errors/4.js index d78326fc3e..b80652b3f5 100644 --- a/Sprint-1/2-mandatory-errors/4.js +++ b/Sprint-1/2-mandatory-errors/4.js @@ -1,6 +1,3 @@ const _12HourClockTime = "20:53"; // identifier can not begin with a number -// or -const $12HourClockTime = "20:53"; // or any change that makes the identifier not stating with digit + const _24hourClockTime = "08:53"; // identifier can not begin with a number -// or -const $24hourClockTime = "08:53"; // or any change that makes the identifier not stating with digit From 2c58925a2e46cfa428bc626c75b7c644781418d3 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Sat, 7 Mar 2026 19:01:31 +0000 Subject: [PATCH 40/68] formatting using prettier --- Sprint-1/3-mandatory-interpret/1-percentage-change.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sprint-1/3-mandatory-interpret/1-percentage-change.js b/Sprint-1/3-mandatory-interpret/1-percentage-change.js index 73b30a9ea4..93dbb12f7e 100644 --- a/Sprint-1/3-mandatory-interpret/1-percentage-change.js +++ b/Sprint-1/3-mandatory-interpret/1-percentage-change.js @@ -29,7 +29,7 @@ console.log(`The percentage change is ${percentageChange}`); // d) Identify all the lines that are variable declarations // the lines that are variable declarations: -line 1 -line 2 -line 7 -line 8 - +// // e) Describe what the expression Number(carPrice.replaceAll(",","")) is doing - what is the purpose of this expression? // the expression calls the replace method to replace the comma with empty string // converting the new string to a number to be able to perform math operations From e1ef6494908c530f1cc162ddd1a1cb543bd49cfd Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Sat, 7 Mar 2026 19:03:01 +0000 Subject: [PATCH 41/68] formatting using prettier --- Sprint-1/3-mandatory-interpret/2-time-format.js | 1 + 1 file changed, 1 insertion(+) diff --git a/Sprint-1/3-mandatory-interpret/2-time-format.js b/Sprint-1/3-mandatory-interpret/2-time-format.js index e2dcfae0ce..89f7168835 100644 --- a/Sprint-1/3-mandatory-interpret/2-time-format.js +++ b/Sprint-1/3-mandatory-interpret/2-time-format.js @@ -30,3 +30,4 @@ console.log(result); // f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer // no it will not work for negative input values as it gives negative results +// From 6f289e86f0071db9f4c2d0fe13e305d801cd45d8 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Sat, 7 Mar 2026 19:04:29 +0000 Subject: [PATCH 42/68] formatting using prettier --- Sprint-1/3-mandatory-interpret/3-to-pounds.js | 1 + 1 file changed, 1 insertion(+) diff --git a/Sprint-1/3-mandatory-interpret/3-to-pounds.js b/Sprint-1/3-mandatory-interpret/3-to-pounds.js index ddb4b40a4d..49d9fab392 100644 --- a/Sprint-1/3-mandatory-interpret/3-to-pounds.js +++ b/Sprint-1/3-mandatory-interpret/3-to-pounds.js @@ -30,3 +30,4 @@ console.log(`£${pounds}.${pence}`); // line 9: using substring method to take only the integer part // line 14: using substring method to take only the decimal part and padend method to make the minimum length of pence to 2 characters by adding zero to the right // line 18: calling console function to print the integer part that represents the pound and the decimal part that represents the pence seprated by point +// From 0dfa64292dcfcef05fc6b7994fbfda885cfec373 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Sun, 8 Mar 2026 15:02:46 +0000 Subject: [PATCH 43/68] trailing / removed and recomended approach taken --- Sprint-1/1-key-exercises/3-paths.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Sprint-1/1-key-exercises/3-paths.js b/Sprint-1/1-key-exercises/3-paths.js index d2be3abade..0273677e14 100644 --- a/Sprint-1/1-key-exercises/3-paths.js +++ b/Sprint-1/1-key-exercises/3-paths.js @@ -17,10 +17,9 @@ console.log(`The base part of ${filePath} is ${base}`); // Create a variable to store the dir part of the filePath variable // Create a variable to store the ext part of the variable -const dir = filePath.slice(0, lastSlashIndex + 1); -const ext = filePath.slice(-3); //the extention of the file is always the last three characters in the path -//or -//const lastPointIndex = filePath.lastIndexOf("."); -//const ext = filePath.slice(lastPointIndex+1); +const dir = filePath.slice(0, lastSlashIndex); + +const lastPointIndex = filePath.lastIndexOf("."); +const ext = filePath.slice(lastPointIndex + 1); // https://www.google.com/search?q=slice+mdn From 7a2b695847b598917459f24a3c847de05bbe33fa Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Sun, 8 Mar 2026 15:49:05 +0000 Subject: [PATCH 44/68] demonstrating precisely what's included and what's excluded. --- Sprint-1/1-key-exercises/4-random.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sprint-1/1-key-exercises/4-random.js b/Sprint-1/1-key-exercises/4-random.js index 4abba35cab..4d450e3019 100644 --- a/Sprint-1/1-key-exercises/4-random.js +++ b/Sprint-1/1-key-exercises/4-random.js @@ -11,10 +11,10 @@ const num = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum; // the num represents a value with limited interval and that's why // the num assigned to a value that's in the dor of an expression // the math object is invoked to perform some mathematical tasks -// the random method is invoked to get a random number between 0 and 1 +// the random method is invoked to get a random number between 0 (inclusive) and 1 (exclusive) // the random number is multiplied by 100 // the floor method is invoked to round down the result to its nearest integer -// added one to the new result +// added one to the new result // the final result of the whole expression is what the variable num assigned to /* after applying the program several times, I got the idea that the program is generating -a value to the num variable thats always between minimum an maximum*/ +a value to the num variable thats always between minimum wich is number 1 (included) and maximum wich is number 100 (included) */ From 9d78d99846e8d05f41cbc586763e1aabb8d3dedb Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Sun, 8 Mar 2026 16:32:11 +0000 Subject: [PATCH 45/68] seggesting to begin a variable name with a lowercase letter. --- Sprint-1/2-mandatory-errors/4.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Sprint-1/2-mandatory-errors/4.js b/Sprint-1/2-mandatory-errors/4.js index b80652b3f5..ab521fdc5b 100644 --- a/Sprint-1/2-mandatory-errors/4.js +++ b/Sprint-1/2-mandatory-errors/4.js @@ -1,3 +1,6 @@ const _12HourClockTime = "20:53"; // identifier can not begin with a number - +//or +// const twelveHourClockTime = "20:53"; // this would be a valid identifier const _24hourClockTime = "08:53"; // identifier can not begin with a number +// or +// const twentyFourHourClockTime = "08:53"; // this would be a valid identifier From 60af85c014f2b8db000f2af6594da81e2b74bb2a Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Sun, 8 Mar 2026 17:28:38 +0000 Subject: [PATCH 46/68] segguesting a descriptive name for the variable --- Sprint-1/3-mandatory-interpret/2-time-format.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sprint-1/3-mandatory-interpret/2-time-format.js b/Sprint-1/3-mandatory-interpret/2-time-format.js index 89f7168835..f390ba3ad4 100644 --- a/Sprint-1/3-mandatory-interpret/2-time-format.js +++ b/Sprint-1/3-mandatory-interpret/2-time-format.js @@ -26,7 +26,7 @@ console.log(result); // e) What do you think the variable result represents? Can you think of a better name for this variable? // it represents the length of the movie in hours, minutes and seconds format -// a better name would be: movieTimeVolume +// a better name would be: formattedTime // f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer // no it will not work for negative input values as it gives negative results From 8ce4854a535f936737a6f18ddae690525c45041c Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Sun, 8 Mar 2026 17:50:44 +0000 Subject: [PATCH 47/68] padend method not really needed here --- Sprint-1/3-mandatory-interpret/3-to-pounds.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sprint-1/3-mandatory-interpret/3-to-pounds.js b/Sprint-1/3-mandatory-interpret/3-to-pounds.js index 49d9fab392..02780d9fed 100644 --- a/Sprint-1/3-mandatory-interpret/3-to-pounds.js +++ b/Sprint-1/3-mandatory-interpret/3-to-pounds.js @@ -28,6 +28,6 @@ console.log(`£${pounds}.${pence}`); // line 3: calling substring method to remove the 'p' letter and keep only digits in the string // line 8: using padstart method to make the minimum length of the string to 3 characters by adding one zero or two to the left. // line 9: using substring method to take only the integer part -// line 14: using substring method to take only the decimal part and padend method to make the minimum length of pence to 2 characters by adding zero to the right +// line 14: using substring method to take only the decimal part and padend method actualy is not needed here because the decimal part will always be 2 characters long // line 18: calling console function to print the integer part that represents the pound and the decimal part that represents the pence seprated by point // From 0d3adae45859f209e9ec86ca5a4fc3d98e89ea0f Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Sun, 8 Mar 2026 23:28:58 +0000 Subject: [PATCH 48/68] Revert "Merge branch 'CodeYourFuture:main' into coursework/sprint-1" This reverts commit 314fa850b9f0d6f9a7f7542c0f1071c3370f15cb, reversing changes made to 8ce4854a535f936737a6f18ddae690525c45041c. --- Sprint-2/4-mandatory-interpret/time-format.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sprint-2/4-mandatory-interpret/time-format.js b/Sprint-2/4-mandatory-interpret/time-format.js index 7c0c7b3cc5..f24c426fb4 100644 --- a/Sprint-2/4-mandatory-interpret/time-format.js +++ b/Sprint-2/4-mandatory-interpret/time-format.js @@ -30,5 +30,5 @@ function formatTimeDisplay(seconds) { // 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 -// e) What is the return value of pad when it is called for the last time in this program? Explain your answer +// e) What is the return value assigned to num when pad is called for the last time in this program? Explain your answer // =============> write your answer here From 99f2a39a2b7489d4b3af6fd32f7ca6c2a4263d81 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Sun, 8 Mar 2026 23:32:02 +0000 Subject: [PATCH 49/68] Revert "Update 0.js" This reverts commit 3bb9ddf441cce7888063f86247f2cf6e8a9ba323. --- Sprint-2/1-key-errors/0.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Sprint-2/1-key-errors/0.js b/Sprint-2/1-key-errors/0.js index 653d6f5a07..39666b0606 100644 --- a/Sprint-2/1-key-errors/0.js +++ b/Sprint-2/1-key-errors/0.js @@ -1,5 +1,5 @@ // Predict and explain first... -// =============> write your prediction here +// =============> the function is not going to work because a variable is declared twice (str) // call the function capitalise with a string input // interpret the error message and figure out why an error is occurring @@ -9,5 +9,10 @@ function capitalise(str) { return str; } -// =============> write your explanation here -// =============> write your new code here +// =============> the error message 'Identifier 'str' has already been declared', diplays because the toUpperCase function does not change the value of the varible declared +// but it creates a new one. +// =============> my new code: +function capitalise(str) { + let result = `${str[0].toUpperCase()}${str.slice(1)}`; + return resault; +} From ce5e2addd08171bf8267c4ec0ad450093adcc37f Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Sun, 8 Mar 2026 23:34:11 +0000 Subject: [PATCH 50/68] Revert "Update 1.js" This reverts commit 177c3687417cddee17598ee568401742d626ac47. --- Sprint-2/1-key-errors/1.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Sprint-2/1-key-errors/1.js b/Sprint-2/1-key-errors/1.js index f2d56151f4..cb2870c5f3 100644 --- a/Sprint-2/1-key-errors/1.js +++ b/Sprint-2/1-key-errors/1.js @@ -1,7 +1,8 @@ // Predict and explain first... // Why will an error occur when this program runs? -// =============> write your prediction here +// =============> because first: the variable decimalNumber is declared twice +// second: the parameter decimalNumber is assigned to a value inside the function // Try playing computer with the example to work out what is going on @@ -14,7 +15,13 @@ function convertToPercentage(decimalNumber) { console.log(decimalNumber); -// =============> write your explanation here +// =============> Identifier 'decimalNumber' has already been declared is the error msg thrown by the code // Finally, correct the code to fix the problem -// =============> write your new code here +// =============> +function convertToPercentage(decimalNumber) { +// const decimalNumber = 0.5; this line must be deleted + const percentage = `${decimalNumber * 100}%`; + + return percentage; +} From dd973e61dcf9cb7a2784c58086de5116e5eb7e9c Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Sun, 8 Mar 2026 23:44:36 +0000 Subject: [PATCH 51/68] Revert "Fix multiply function to return result and log output" This reverts commit 5809aeec54cfeae9d2cd763b7f590d7566076987. --- Sprint-2/2-mandatory-debug/0.js | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/Sprint-2/2-mandatory-debug/0.js b/Sprint-2/2-mandatory-debug/0.js index bd32b29c01..b27511b417 100644 --- a/Sprint-2/2-mandatory-debug/0.js +++ b/Sprint-2/2-mandatory-debug/0.js @@ -1,6 +1,6 @@ // Predict and explain first... -// =============> the function when called will throw an error +// =============> write your prediction here function multiply(a, b) { console.log(a * b); @@ -8,19 +8,7 @@ function multiply(a, b) { console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`); -// =============> the function multiply has no return statement +// =============> write your explanation here // Finally, correct the code to fix the problem -// =============> -function multiply(a, b) { - return (a * b); // we change the console.log statement with the return statement -} - -console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`); - -// an extra notice: the purpose of creating a function is to reuse it when needed -// I've noticed that the parameters are already assigned to values 10 and 32, so I changed the code to the following: -function multiply(a, b) { - return console.log(`The result of multiplying ` + a +` and ` + b +` is ` + (a * b)); -} -multiply(10, 32); +// =============> write your new code here From a7d7dfd7b861946d7d1021db91732605c591b0fe Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Mon, 9 Mar 2026 00:01:40 +0000 Subject: [PATCH 52/68] Revert "declaraing the variable 'result' in capitalise function" This reverts commit 4fdfb0707d0ae38a1cef926a9668fff91f466c47. --- Sprint-2/1-key-errors/0.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sprint-2/1-key-errors/0.js b/Sprint-2/1-key-errors/0.js index 39666b0606..26eec1a581 100644 --- a/Sprint-2/1-key-errors/0.js +++ b/Sprint-2/1-key-errors/0.js @@ -13,6 +13,6 @@ function capitalise(str) { // but it creates a new one. // =============> my new code: function capitalise(str) { - let result = `${str[0].toUpperCase()}${str.slice(1)}`; + result = `${str[0].toUpperCase()}${str.slice(1)}`; return resault; } From 0714db20e223fbeefe051bec83db3d8e58d300ff Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Mon, 9 Mar 2026 00:19:19 +0000 Subject: [PATCH 53/68] Update 0.js --- Sprint-2/1-key-errors/0.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sprint-2/1-key-errors/0.js b/Sprint-2/1-key-errors/0.js index 26eec1a581..137eee2703 100644 --- a/Sprint-2/1-key-errors/0.js +++ b/Sprint-2/1-key-errors/0.js @@ -13,6 +13,10 @@ function capitalise(str) { // but it creates a new one. // =============> my new code: function capitalise(str) { +<<<<<<< HEAD result = `${str[0].toUpperCase()}${str.slice(1)}`; +======= + let result = `${str[0].toUpperCase()}${str.slice(1)}`; +>>>>>>> parent of 3bb9ddf (Update 0.js) return resault; } From 895a3adc76a5b382afc41874b8f01627f82b4c4b Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Mon, 9 Mar 2026 00:20:57 +0000 Subject: [PATCH 54/68] Revert "Update 2.js" This reverts commit bbdcc95453a99e5c11041e9dd0ad2580d9fc22ab. --- Sprint-2/1-key-errors/2.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Sprint-2/1-key-errors/2.js b/Sprint-2/1-key-errors/2.js index 09ecc04999..25eb01a122 100644 --- a/Sprint-2/1-key-errors/2.js +++ b/Sprint-2/1-key-errors/2.js @@ -3,16 +3,22 @@ // this function should square any number but instead we're going to get an error -// =============> write your prediction of the error here +// =============> identifier not declared (unknown) function square(3) { return num * num; } -// =============> write the error message here +// =============> Unexpected number -// =============> explain this error message here +// =============> the parameter shouldn't be given an argument in the function definition // Finally, correct the code to fix the problem -// =============> write your new code here +// =============> my new code +function square(num) { + return num * num; +} +console.log(square(3)); + + From 41d60eb0b0614cbf0c31020c88ecf95afd009580 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Mon, 9 Mar 2026 00:25:32 +0000 Subject: [PATCH 55/68] Reapply "Update 2.js" This reverts commit 895a3adc76a5b382afc41874b8f01627f82b4c4b. --- Sprint-2/1-key-errors/2.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/Sprint-2/1-key-errors/2.js b/Sprint-2/1-key-errors/2.js index 25eb01a122..09ecc04999 100644 --- a/Sprint-2/1-key-errors/2.js +++ b/Sprint-2/1-key-errors/2.js @@ -3,22 +3,16 @@ // this function should square any number but instead we're going to get an error -// =============> identifier not declared (unknown) +// =============> write your prediction of the error here function square(3) { return num * num; } -// =============> Unexpected number +// =============> write the error message here -// =============> the parameter shouldn't be given an argument in the function definition +// =============> explain this error message here // Finally, correct the code to fix the problem -// =============> my new code -function square(num) { - return num * num; -} -console.log(square(3)); - - +// =============> write your new code here From 64c81746f7a34641b72387a5233446cf45cfeb9f Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Mon, 9 Mar 2026 00:28:32 +0000 Subject: [PATCH 56/68] Revert "Update 0.js" This reverts commit 0714db20e223fbeefe051bec83db3d8e58d300ff. --- Sprint-2/1-key-errors/0.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Sprint-2/1-key-errors/0.js b/Sprint-2/1-key-errors/0.js index 137eee2703..26eec1a581 100644 --- a/Sprint-2/1-key-errors/0.js +++ b/Sprint-2/1-key-errors/0.js @@ -13,10 +13,6 @@ function capitalise(str) { // but it creates a new one. // =============> my new code: function capitalise(str) { -<<<<<<< HEAD result = `${str[0].toUpperCase()}${str.slice(1)}`; -======= - let result = `${str[0].toUpperCase()}${str.slice(1)}`; ->>>>>>> parent of 3bb9ddf (Update 0.js) return resault; } From a0791acff5258b2a8f9b2c256191496d4577b2de Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Mon, 9 Mar 2026 00:29:31 +0000 Subject: [PATCH 57/68] Reapply "Update 0.js" This reverts commit 64c81746f7a34641b72387a5233446cf45cfeb9f. --- Sprint-2/1-key-errors/0.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sprint-2/1-key-errors/0.js b/Sprint-2/1-key-errors/0.js index 26eec1a581..137eee2703 100644 --- a/Sprint-2/1-key-errors/0.js +++ b/Sprint-2/1-key-errors/0.js @@ -13,6 +13,10 @@ function capitalise(str) { // but it creates a new one. // =============> my new code: function capitalise(str) { +<<<<<<< HEAD result = `${str[0].toUpperCase()}${str.slice(1)}`; +======= + let result = `${str[0].toUpperCase()}${str.slice(1)}`; +>>>>>>> parent of 3bb9ddf (Update 0.js) return resault; } From 40804b42f26dbc96858fb12ecfdf5fad3ee699ed Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Mon, 9 Mar 2026 00:30:34 +0000 Subject: [PATCH 58/68] Revert "Update 0.js" This reverts commit 0714db20e223fbeefe051bec83db3d8e58d300ff. --- Sprint-2/1-key-errors/0.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Sprint-2/1-key-errors/0.js b/Sprint-2/1-key-errors/0.js index 137eee2703..26eec1a581 100644 --- a/Sprint-2/1-key-errors/0.js +++ b/Sprint-2/1-key-errors/0.js @@ -13,10 +13,6 @@ function capitalise(str) { // but it creates a new one. // =============> my new code: function capitalise(str) { -<<<<<<< HEAD result = `${str[0].toUpperCase()}${str.slice(1)}`; -======= - let result = `${str[0].toUpperCase()}${str.slice(1)}`; ->>>>>>> parent of 3bb9ddf (Update 0.js) return resault; } From c30133657af690f3c6d597d1e1f6810387970757 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Mon, 9 Mar 2026 00:31:19 +0000 Subject: [PATCH 59/68] Reapply "declaraing the variable 'result' in capitalise function" This reverts commit a7d7dfd7b861946d7d1021db91732605c591b0fe. --- Sprint-2/1-key-errors/0.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sprint-2/1-key-errors/0.js b/Sprint-2/1-key-errors/0.js index 26eec1a581..39666b0606 100644 --- a/Sprint-2/1-key-errors/0.js +++ b/Sprint-2/1-key-errors/0.js @@ -13,6 +13,6 @@ function capitalise(str) { // but it creates a new one. // =============> my new code: function capitalise(str) { - result = `${str[0].toUpperCase()}${str.slice(1)}`; + let result = `${str[0].toUpperCase()}${str.slice(1)}`; return resault; } From dc13db49ab5249edda9c7859c66917e10206bd63 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Mon, 9 Mar 2026 00:32:31 +0000 Subject: [PATCH 60/68] Reapply "Update 0.js" This reverts commit 99f2a39a2b7489d4b3af6fd32f7ca6c2a4263d81. --- Sprint-2/1-key-errors/0.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Sprint-2/1-key-errors/0.js b/Sprint-2/1-key-errors/0.js index 39666b0606..653d6f5a07 100644 --- a/Sprint-2/1-key-errors/0.js +++ b/Sprint-2/1-key-errors/0.js @@ -1,5 +1,5 @@ // Predict and explain first... -// =============> the function is not going to work because a variable is declared twice (str) +// =============> write your prediction here // call the function capitalise with a string input // interpret the error message and figure out why an error is occurring @@ -9,10 +9,5 @@ function capitalise(str) { return str; } -// =============> the error message 'Identifier 'str' has already been declared', diplays because the toUpperCase function does not change the value of the varible declared -// but it creates a new one. -// =============> my new code: -function capitalise(str) { - let result = `${str[0].toUpperCase()}${str.slice(1)}`; - return resault; -} +// =============> write your explanation here +// =============> write your new code here From 784fb4b07a6b1fb23d0b6c261721574bf33183ca Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Mon, 9 Mar 2026 00:34:27 +0000 Subject: [PATCH 61/68] Reapply "Update 1.js" This reverts commit ce5e2addd08171bf8267c4ec0ad450093adcc37f. --- Sprint-2/1-key-errors/1.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/Sprint-2/1-key-errors/1.js b/Sprint-2/1-key-errors/1.js index cb2870c5f3..f2d56151f4 100644 --- a/Sprint-2/1-key-errors/1.js +++ b/Sprint-2/1-key-errors/1.js @@ -1,8 +1,7 @@ // Predict and explain first... // Why will an error occur when this program runs? -// =============> because first: the variable decimalNumber is declared twice -// second: the parameter decimalNumber is assigned to a value inside the function +// =============> write your prediction here // Try playing computer with the example to work out what is going on @@ -15,13 +14,7 @@ function convertToPercentage(decimalNumber) { console.log(decimalNumber); -// =============> Identifier 'decimalNumber' has already been declared is the error msg thrown by the code +// =============> write your explanation here // Finally, correct the code to fix the problem -// =============> -function convertToPercentage(decimalNumber) { -// const decimalNumber = 0.5; this line must be deleted - const percentage = `${decimalNumber * 100}%`; - - return percentage; -} +// =============> write your new code here From 987f73580adcc8265c73f81c3664b9eb5a0926e1 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Mon, 9 Mar 2026 00:45:29 +0000 Subject: [PATCH 62/68] Reapply "Merge branch 'CodeYourFuture:main' into coursework/sprint-1" This reverts commit 0d3adae45859f209e9ec86ca5a4fc3d98e89ea0f. --- Sprint-2/4-mandatory-interpret/time-format.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sprint-2/4-mandatory-interpret/time-format.js b/Sprint-2/4-mandatory-interpret/time-format.js index f24c426fb4..7c0c7b3cc5 100644 --- a/Sprint-2/4-mandatory-interpret/time-format.js +++ b/Sprint-2/4-mandatory-interpret/time-format.js @@ -30,5 +30,5 @@ function formatTimeDisplay(seconds) { // 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 -// e) What is the return value assigned to num when pad is called for the last time in this program? Explain your answer +// 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 From 8eed65bdcea4b3ddd8459bbcdde058639f9341d5 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Mon, 9 Mar 2026 00:46:53 +0000 Subject: [PATCH 63/68] Revert "Merge branch 'CodeYourFuture:main' into coursework/sprint-1" This reverts commit 314fa850b9f0d6f9a7f7542c0f1071c3370f15cb, reversing changes made to 8ce4854a535f936737a6f18ddae690525c45041c. --- Sprint-2/4-mandatory-interpret/time-format.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sprint-2/4-mandatory-interpret/time-format.js b/Sprint-2/4-mandatory-interpret/time-format.js index 7c0c7b3cc5..f24c426fb4 100644 --- a/Sprint-2/4-mandatory-interpret/time-format.js +++ b/Sprint-2/4-mandatory-interpret/time-format.js @@ -30,5 +30,5 @@ function formatTimeDisplay(seconds) { // 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 -// e) What is the return value of pad when it is called for the last time in this program? Explain your answer +// e) What is the return value assigned to num when pad is called for the last time in this program? Explain your answer // =============> write your answer here From ad6a62836fbfbb036d5f0f1d1268e75b22b8651e Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Mon, 9 Mar 2026 00:49:17 +0000 Subject: [PATCH 64/68] Revert "Clean up comments in time-format.js" This reverts commit 5196c63e432fb64607e334dd9dfcedff1d734275. --- Sprint-2/4-mandatory-interpret/time-format.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/Sprint-2/4-mandatory-interpret/time-format.js b/Sprint-2/4-mandatory-interpret/time-format.js index f24c426fb4..a5facbec84 100644 --- a/Sprint-2/4-mandatory-interpret/time-format.js +++ b/Sprint-2/4-mandatory-interpret/time-format.js @@ -17,18 +17,27 @@ function formatTimeDisplay(seconds) { // Questions // a) When formatTimeDisplay is called how many times will pad be called? - +// =============> pad will be called 3 times // 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 +// =============> the value assigned to num is 0 // c) What is the return value of pad is called for the first time? -// =============> write your answer here +// =============> the return value of pad is called for the first time is "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 +// =============> the value assigned to num is 1 +// because the last time pad is called for the remainingSeconds holding the value 1 +// return pad(remainingSeconds) +// function pad(1){ // e) What is the return value assigned to num when pad is called for the last time in this program? Explain your answer -// =============> write your answer here +// =============> the return value of pad is called for the last time is "01" +// because the argument passed to the pad parameter is the value of the remainingSeconds wich is 1 +// function pad(1){ +// return 1.toString().padStart(2, "0"); +// return "1".pad(2,"0"); +// return "01" +//} From a68f54624fded1f70cbc1ba53343fdd26245cf0e Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Mon, 9 Mar 2026 00:50:26 +0000 Subject: [PATCH 65/68] Revert "Clarify pad function behavior in comments" This reverts commit 56b74d5f822563c2bf7600d712a49a7ecc154b99. --- Sprint-2/4-mandatory-interpret/time-format.js | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/Sprint-2/4-mandatory-interpret/time-format.js b/Sprint-2/4-mandatory-interpret/time-format.js index a5facbec84..7c98eb0e8c 100644 --- a/Sprint-2/4-mandatory-interpret/time-format.js +++ b/Sprint-2/4-mandatory-interpret/time-format.js @@ -17,27 +17,18 @@ function formatTimeDisplay(seconds) { // Questions // a) When formatTimeDisplay is called how many times will pad be called? -// =============> pad will be called 3 times +// =============> write your answer here // 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? -// =============> the value assigned to num is 0 +// =============> write your answer here // c) What is the return value of pad is called for the first time? -// =============> the return value of pad is called for the first time is "00" +// =============> write your answer here // d) What is the value assigned to num when pad is called for the last time in this program? Explain your answer -// =============> the value assigned to num is 1 -// because the last time pad is called for the remainingSeconds holding the value 1 -// return pad(remainingSeconds) -// function pad(1){ +// =============> write your answer here // e) What is the return value assigned to num when pad is called for the last time in this program? Explain your answer -// =============> the return value of pad is called for the last time is "01" -// because the argument passed to the pad parameter is the value of the remainingSeconds wich is 1 -// function pad(1){ -// return 1.toString().padStart(2, "0"); -// return "1".pad(2,"0"); -// return "01" -//} +// =============> write your answer here From 92566175216652cf2db8a7c77dbad8a9d828cce4 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Mon, 9 Mar 2026 01:03:54 +0000 Subject: [PATCH 66/68] Revert "Update 2.js" This reverts commit bbdcc95453a99e5c11041e9dd0ad2580d9fc22ab. --- Sprint-2/1-key-errors/2.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Sprint-2/1-key-errors/2.js b/Sprint-2/1-key-errors/2.js index 09ecc04999..25eb01a122 100644 --- a/Sprint-2/1-key-errors/2.js +++ b/Sprint-2/1-key-errors/2.js @@ -3,16 +3,22 @@ // this function should square any number but instead we're going to get an error -// =============> write your prediction of the error here +// =============> identifier not declared (unknown) function square(3) { return num * num; } -// =============> write the error message here +// =============> Unexpected number -// =============> explain this error message here +// =============> the parameter shouldn't be given an argument in the function definition // Finally, correct the code to fix the problem -// =============> write your new code here +// =============> my new code +function square(num) { + return num * num; +} +console.log(square(3)); + + From 0391e7dfb11ec5b55a128fac4c81710bfae90b56 Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Mon, 9 Mar 2026 01:06:41 +0000 Subject: [PATCH 67/68] Revert "Fix square function parameter" This reverts commit 3bcd5ba7f028cd57a445df6af8e4684f3b778d73. --- Sprint-2/1-key-errors/2.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Sprint-2/1-key-errors/2.js b/Sprint-2/1-key-errors/2.js index 25eb01a122..aad57f7cfe 100644 --- a/Sprint-2/1-key-errors/2.js +++ b/Sprint-2/1-key-errors/2.js @@ -3,22 +3,18 @@ // this function should square any number but instead we're going to get an error -// =============> identifier not declared (unknown) +// =============> write your prediction of the error here function square(3) { return num * num; } -// =============> Unexpected number +// =============> write the error message here -// =============> the parameter shouldn't be given an argument in the function definition +// =============> explain this error message here // Finally, correct the code to fix the problem -// =============> my new code -function square(num) { - return num * num; -} -console.log(square(3)); +// =============> write your new code here From eac0a0432aa6f5266a32ebca02fb9f1e08e908de Mon Sep 17 00:00:00 2001 From: boladjebsoft Date: Mon, 9 Mar 2026 01:11:52 +0000 Subject: [PATCH 68/68] Reapply "Merge branch 'CodeYourFuture:main' into coursework/sprint-1" This reverts commit 0d3adae45859f209e9ec86ca5a4fc3d98e89ea0f. --- Sprint-2/4-mandatory-interpret/time-format.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sprint-2/4-mandatory-interpret/time-format.js b/Sprint-2/4-mandatory-interpret/time-format.js index 7c98eb0e8c..15d5798054 100644 --- a/Sprint-2/4-mandatory-interpret/time-format.js +++ b/Sprint-2/4-mandatory-interpret/time-format.js @@ -30,5 +30,5 @@ function formatTimeDisplay(seconds) { // 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 -// e) What is the return value assigned to num when pad is called for the last time in this program? Explain your answer +// 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