From 4032809f46174d16847f875b0a4b74b29a2ac1f8 Mon Sep 17 00:00:00 2001 From: Ebrahim_Moqbel Date: Tue, 13 Jan 2026 16:42:23 +0000 Subject: [PATCH 01/29] A reason for me to join CYF --- Wireframe/articles.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 Wireframe/articles.md diff --git a/Wireframe/articles.md b/Wireframe/articles.md new file mode 100644 index 000000000..667f5c685 --- /dev/null +++ b/Wireframe/articles.md @@ -0,0 +1,3 @@ +- Why did I chose Code Your Future to study along with my uni studies? + +I chose Code Your Future alongside my university studies because tech is about more than just code—it’s about community. CYF offers a unique space to belong and grow, providing the holistic support and professional network that transforms a student into a leader." \ No newline at end of file From 50fcc71e882c0e8610734c7ee04b8864c8a8ac0b Mon Sep 17 00:00:00 2001 From: Ebrahim_Moqbel Date: Tue, 13 Jan 2026 16:47:40 +0000 Subject: [PATCH 02/29] Reson --- Wireframe/articles.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Wireframe/articles.md b/Wireframe/articles.md index 667f5c685..52e91f747 100644 --- a/Wireframe/articles.md +++ b/Wireframe/articles.md @@ -1,3 +1,3 @@ - Why did I chose Code Your Future to study along with my uni studies? -I chose Code Your Future alongside my university studies because tech is about more than just code—it’s about community. CYF offers a unique space to belong and grow, providing the holistic support and professional network that transforms a student into a leader." \ No newline at end of file +I chose Code Your Future alongside my university studies because tech is about more than just code—it’s about community. \ No newline at end of file From 749a8867b90215678ea523c23aabdac76285a931 Mon Sep 17 00:00:00 2001 From: Ebrahim_Moqbel Date: Tue, 13 Jan 2026 17:57:03 +0000 Subject: [PATCH 03/29] What is Git and why is it being used? --- Wireframe/articles.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Wireframe/articles.md b/Wireframe/articles.md index 52e91f747..f6a6e6d94 100644 --- a/Wireframe/articles.md +++ b/Wireframe/articles.md @@ -1,3 +1,8 @@ -- Why did I chose Code Your Future to study along with my uni studies? +What is Git? -I chose Code Your Future alongside my university studies because tech is about more than just code—it’s about community. \ No newline at end of file +Git is a version control system used for tracking changes in computer files. It is generally used for source code management in software development. + +Git is used to tracking changes in the source code +The distributed version control tool is used for source code management +It allows multiple developers to work together +It supports non-linear development through its thousands of parallel branches \ No newline at end of file From 0173feafdad799c001141089fd35e00abb06694f Mon Sep 17 00:00:00 2001 From: Ebrahim_Moqbel Date: Tue, 13 Jan 2026 18:27:59 +0000 Subject: [PATCH 04/29] Article on the purpos of git --- Wireframe/articles.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Wireframe/articles.md b/Wireframe/articles.md index f6a6e6d94..7d387e883 100644 --- a/Wireframe/articles.md +++ b/Wireframe/articles.md @@ -1,4 +1,4 @@ -What is Git? +nWhat is Git? Git is a version control system used for tracking changes in computer files. It is generally used for source code management in software development. From 84147a6ffc3a83d63d980360d6a623cebb72621e Mon Sep 17 00:00:00 2001 From: Ebrahim_Moqbel Date: Mon, 2 Feb 2026 17:08:02 +0000 Subject: [PATCH 05/29] form control --- Form-Controls/index.html | 43 ++++++++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/Form-Controls/index.html b/Form-Controls/index.html index 65a866cdb..869046390 100644 --- a/Form-Controls/index.html +++ b/Form-Controls/index.html @@ -12,16 +12,47 @@

Product Pick

-
- - + +
+ +
+ + +
+ +
+ + +
+ +
+ T-shirt Color +
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +
+
-

By HOMEWORK SOLUTION

+

By Ebraim Moqbel

From 280c8fdc0797720cadd52e07b015c65533d053d2 Mon Sep 17 00:00:00 2001 From: Ebrahim_Moqbel Date: Mon, 2 Feb 2026 17:09:04 +0000 Subject: [PATCH 06/29] size div --- Form-Controls/index.html | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Form-Controls/index.html b/Form-Controls/index.html index 869046390..6a31322f8 100644 --- a/Form-Controls/index.html +++ b/Form-Controls/index.html @@ -43,7 +43,17 @@

Product Pick

- +
+ + +
From 270dbee31f465ec646af181f9e6f1a8ee6ac3de7 Mon Sep 17 00:00:00 2001 From: Ebrahim_Moqbel Date: Mon, 2 Feb 2026 17:21:03 +0000 Subject: [PATCH 07/29] unwanted article deleted --- Wireframe/articles.md | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 Wireframe/articles.md diff --git a/Wireframe/articles.md b/Wireframe/articles.md deleted file mode 100644 index 7d387e883..000000000 --- a/Wireframe/articles.md +++ /dev/null @@ -1,8 +0,0 @@ -nWhat is Git? - -Git is a version control system used for tracking changes in computer files. It is generally used for source code management in software development. - -Git is used to tracking changes in the source code -The distributed version control tool is used for source code management -It allows multiple developers to work together -It supports non-linear development through its thousands of parallel branches \ No newline at end of file From 697f95f7295fa104a0ad4f6dac98765d2c147fc2 Mon Sep 17 00:00:00 2001 From: Ebrahim_Moqbel Date: Sat, 7 Feb 2026 11:37:02 +0000 Subject: [PATCH 08/29] labelling the T-shirt size and chaninging the color section to be recquired --- Form-Controls/index.html | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Form-Controls/index.html b/Form-Controls/index.html index 6a31322f8..6c32dcc03 100644 --- a/Form-Controls/index.html +++ b/Form-Controls/index.html @@ -14,37 +14,37 @@

Product Pick

- +
- +
- + +
- T-shirt Color + t-shirt Color
- - + +
- +
- +
- + +
- + + +
- - + +
- - + +
- - From bb654559fbe67fe1bcefe62fd2eb7e10860de1dc Mon Sep 17 00:00:00 2001 From: Ebrahim_Moqbel Date: Fri, 4 Sep 2026 17:10:41 +0100 Subject: [PATCH 10/29] completed the key-errors requirements file --- Sprint-3/1-key-errors/0.js | 25 +++++++++++++++++++++---- Sprint-3/1-key-errors/1.js | 27 +++++++++++++++++++-------- Sprint-3/1-key-errors/2.js | 16 ++++++++++++---- 3 files changed, 52 insertions(+), 16 deletions(-) diff --git a/Sprint-3/1-key-errors/0.js b/Sprint-3/1-key-errors/0.js index 653d6f5a0..58c55ec50 100644 --- a/Sprint-3/1-key-errors/0.js +++ b/Sprint-3/1-key-errors/0.js @@ -1,13 +1,30 @@ // Predict and explain first... // =============> write your prediction here +/* +I predict the function will throw a SyntaxError as the variable str has already been declared in the function parameter +function capitalise will capitalise the first letter with index 0 +and will append the sliced string from index 1 which is the second letter +*/ // call the function capitalise with a string input // interpret the error message and figure out why an error is occurring -function capitalise(str) { - let str = `${str[0].toUpperCase()}${str.slice(1)}`; - return str; -} +/* syntax Error :identifier the variabel has already been declared. +As we can see the str variable has already been declared in the prameter of the function instead we just return the value */ + +// function capitalise(str) { +// let str = `${str[0].toUpperCase()}${str.slice(1)}`; +// return str; +// } // =============> write your explanation here +/* syntax Error :identifier the variabel has already been declared. +As we can see the str variable has already been declared in the prameter of the function instead we just return the value */ + // =============> write your new code here +function capitalise(str) { + return str[0].toUpperCase()+str.slice(1); + +} +console.log(capitalise("ebrahim")); +console.log(capitalise('salomi')); diff --git a/Sprint-3/1-key-errors/1.js b/Sprint-3/1-key-errors/1.js index f2d56151f..8fafe081e 100644 --- a/Sprint-3/1-key-errors/1.js +++ b/Sprint-3/1-key-errors/1.js @@ -3,18 +3,29 @@ // Why will an error occur when this program runs? // =============> write your prediction here -// Try playing computer with the example to work out what is going on +//1- The function is trying to declare the decimalNumber twice in the perameter and later as a new variable +//2-console.log() is printing a variable in the local scope where it can't be accessed as it is inside the function -function convertToPercentage(decimalNumber) { - const decimalNumber = 0.5; - const percentage = `${decimalNumber * 100}%`; +// Try playing computer with the example to work out what is going on - return percentage; -} +// function convertToPercentage(decimalNumber) { +// const decimalNumber = 0.5; +// const percentage = `${decimalNumber * 100}%`; -console.log(decimalNumber); +// return percentage; +// } // =============> write your explanation here +/* The variable decimal Number has already been declared in the parameter + and already is a local variable which can't be declared again causing a SyntaxError +As the decimalNumber inside the function we can't print it using the console.log() as it has no power to the local scope +instead we can delete the second declaration and just leave the parameter as an input for the user + Finally, correct the code to fix the problem */ -// 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(0.5)); \ No newline at end of file diff --git a/Sprint-3/1-key-errors/2.js b/Sprint-3/1-key-errors/2.js index aad57f7cf..93ffedaa3 100644 --- a/Sprint-3/1-key-errors/2.js +++ b/Sprint-3/1-key-errors/2.js @@ -1,20 +1,28 @@ - // 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 predict the funciton will throw a SyntaxEror as the perametters sould be valid variables like names or identifiers with upholding to the variable naming convention and in this case a number found -function square(3) { - return num * num; -} +// function square(3) { +// return num * num; +// } // =============> write the error message here +//the Error is a syntax error: Unexpected number // =============> explain this error message here +/* The function was givin a number as its perameter where in JS only allows varaible names and usnig a number causes a SyntaxError + Also, the function was returning num*num where num is undefined causing a syntax error + */ // Finally, correct the code to fix the problem // =============> write your new code here +function square(num) { + return num * num; +} +console.log(square(25)); \ No newline at end of file From 200896247b498e1383e86f3f5d407491e8a125f9 Mon Sep 17 00:00:00 2001 From: Ebrahim_Moqbel Date: Fri, 4 Sep 2026 17:16:21 +0100 Subject: [PATCH 11/29] completed the mandatory debug file --- Sprint-3/2-mandatory-debug/0.js | 16 +++++++++++---- Sprint-3/2-mandatory-debug/1.js | 20 ++++++++++++++----- Sprint-3/2-mandatory-debug/2.js | 35 ++++++++++++++++++++++++++------- 3 files changed, 55 insertions(+), 16 deletions(-) diff --git a/Sprint-3/2-mandatory-debug/0.js b/Sprint-3/2-mandatory-debug/0.js index b27511b41..7c0c923d0 100644 --- a/Sprint-3/2-mandatory-debug/0.js +++ b/Sprint-3/2-mandatory-debug/0.js @@ -1,14 +1,22 @@ // Predict and explain first... // =============> write your prediction here +// This function would multiply the two arguments a and b whatever that is +// when we log the output we will get the string and the output of the function but because we are not returning an output we might run into an error -function multiply(a, b) { - console.log(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 +//The console.log() inside the funtion will print a*b but when we call the function will return undefined // Finally, correct the code to fix the problem // =============> write your new code here +function multiply(a, b) { + return a * b; +} + +console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`); \ No newline at end of file diff --git a/Sprint-3/2-mandatory-debug/1.js b/Sprint-3/2-mandatory-debug/1.js index 37cedfbcf..dab4d1cba 100644 --- a/Sprint-3/2-mandatory-debug/1.js +++ b/Sprint-3/2-mandatory-debug/1.js @@ -1,13 +1,23 @@ // Predict and explain first... // =============> write your prediction here +// The function suppose to return the sum of the two variables but we will encounter an error as the code after return is unreachable. -function sum(a, b) { - return; - a + b; -} -console.log(`The sum of 10 and 32 is ${sum(10, 32)}`); +// function sum(a, b) { +// return; +// a + b; +// } +// console.log(`The sum of 10 and 32 is ${sum(10, 32)}`); // =============> write your explanation here + +// As we return nothing by closing the line with a semicolon hence a + b is not returned where we tell the computer to exit and go back to global scope and the computer will not be able to read the lines after that + // 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)}`); \ No newline at end of file diff --git a/Sprint-3/2-mandatory-debug/2.js b/Sprint-3/2-mandatory-debug/2.js index 57d3f5dc3..9ad326b24 100644 --- a/Sprint-3/2-mandatory-debug/2.js +++ b/Sprint-3/2-mandatory-debug/2.js @@ -2,23 +2,44 @@ // Predict the output of the following code: // =============> Write your prediction here +//getLastDigit will convert a number to a string +// However, since there is no parameter or local variable to the function we might run into an Error -const num = 103; +// const num = 103; -function getLastDigit() { - return num.toString().slice(-1); -} +// 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)}`); +// 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)}`); // 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 +// As expected, the function has no parameters, so it relies on the global variable "num" as its only variable. +// Since there are no parameters defined, the function permanently uses the global variable instead. +// This means even if we pass arguments when calling the function, they will be ignored because there are no parameters to receive them. + // Finally, correct the code to fix the problem // =============> write your new code here +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 +/* the reason why getLastDigit isn't working properly is that it doesn't accept any arrguments where there isn't any perameters in its difination. +where it uses the golabal varaible 'num' decalred outside the funtion and already set to 103 + +The correct code includes a parameter 'num' in the difination this allows the function to accept the number passed to it when called*/ \ No newline at end of file From 6db1797f075bcde486859a6e0d526f039472ec14 Mon Sep 17 00:00:00 2001 From: Ebrahim_Moqbel Date: Fri, 4 Sep 2026 17:18:40 +0100 Subject: [PATCH 12/29] completed the mandatory implement file --- Sprint-3/3-mandatory-implement/1-bmi.js | 12 +++++++--- Sprint-3/3-mandatory-implement/2-cases.js | 5 ++++ Sprint-3/3-mandatory-implement/3-to-pounds.js | 23 ++++++++++++++++++- 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/Sprint-3/3-mandatory-implement/1-bmi.js b/Sprint-3/3-mandatory-implement/1-bmi.js index 58b1085f1..fb2498599 100644 --- a/Sprint-3/3-mandatory-implement/1-bmi.js +++ b/Sprint-3/3-mandatory-implement/1-bmi.js @@ -6,14 +6,20 @@ // squaring your height: 1.73 x 1.73 = 2.99 // dividing 70 by 2.99 = 23.41 -// Your result will be displayed to 1 decimal place, for example '23.4'. +// Your result will be displayed to 1 decimal place, for example 23.4. // You will need to implement a function that calculates the BMI of someone based off their weight and height // Given someone's weight in kg and height in metres // Then when we call this function with the weight and height -// It should return a string of their Body Mass Index to 1 decimal place +// It should return their Body Mass Index to 1 decimal place function calculateBMI(weight, height) { - // return the BMI of someone based off their weight and height + let result = (weight/(height*height)); + return Number(result.toFixed(1)); + + } + +console.log(calculateBMI(70,1.7)) +console.log(calculateBMI(72,1.7)) \ No newline at end of file diff --git a/Sprint-3/3-mandatory-implement/2-cases.js b/Sprint-3/3-mandatory-implement/2-cases.js index 5b0ef77ad..ab8775b9b 100644 --- a/Sprint-3/3-mandatory-implement/2-cases.js +++ b/Sprint-3/3-mandatory-implement/2-cases.js @@ -14,3 +14,8 @@ // 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 toUpperSnakeCase(string) { + return string.toUpperCase().replaceAll(" ", "_"); +} +console.log(toUpperSnakeCase("hello there")); +console.log(toUpperSnakeCase("lord of the rings")); \ No newline at end of file diff --git a/Sprint-3/3-mandatory-implement/3-to-pounds.js b/Sprint-3/3-mandatory-implement/3-to-pounds.js index 10754da73..6d6d0502c 100644 --- a/Sprint-3/3-mandatory-implement/3-to-pounds.js +++ b/Sprint-3/3-mandatory-implement/3-to-pounds.js @@ -1,6 +1,27 @@ -// In Sprint-1, there is a program written in 3-mandatory-interpret/3-to-pounds.js +// In Sprint-1, there is a program written in interpret/to-pounds.js // You will need to take this code and turn it into a reusable block of code. // 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 `£${pounds}.${pence}` + } + + +console.log(toPounds('987p')); +console.log(toPounds('909p')); +console.log(toPounds('345p')); \ No newline at end of file From b93870ee88a006c1743ff15c6df4ca299197b288 Mon Sep 17 00:00:00 2001 From: Ebrahim_Moqbel Date: Fri, 4 Sep 2026 17:19:59 +0100 Subject: [PATCH 13/29] completed the time format specification file --- Sprint-3/4-mandatory-interpret/time-format.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Sprint-3/4-mandatory-interpret/time-format.js b/Sprint-3/4-mandatory-interpret/time-format.js index c0dd9c9a5..0c21d173c 100644 --- a/Sprint-3/4-mandatory-interpret/time-format.js +++ b/Sprint-3/4-mandatory-interpret/time-format.js @@ -15,24 +15,27 @@ 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 // Questions // a) When formatTimeDisplay is called how many times will pad be called? -// =============> write your answer here +// =============> 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 first time pad was called with 61 the value is 00:01:01 -// c) What is the return value of pad when it is called for the first time? -// =============> write your answer here +// c) What is the return value of pad is called for the first time? +// =============> "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 +// the last time, pad() is called with the remaining seconds which is value 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 +// =============> 1 +// the return value is "1" but as we are using pad would be adding a leading of "0" to become "01" \ No newline at end of file From a1ecaa42de87f5d78327558bde6522b9fadeb859 Mon Sep 17 00:00:00 2001 From: Ebrahim_Moqbel Date: Fri, 4 Sep 2026 17:43:57 +0100 Subject: [PATCH 14/29] deleting the changes of the from controls file from brach sprint -3 --- Form-Controls/index.html | 65 +++++----------------------------------- 1 file changed, 7 insertions(+), 58 deletions(-) diff --git a/Form-Controls/index.html b/Form-Controls/index.html index c83b7d962..74b591ffc 100644 --- a/Form-Controls/index.html +++ b/Form-Controls/index.html @@ -12,67 +12,16 @@

Product Pick

- -
- -
- - -
- -
- - -
- - -
- T-shirt Color -
- - -
-
- - -
-
- - -
-
- - -
- - -
-
- -
-
+ + +
- -

By Ebraim Moqbel

+ +

By HOMEWORK SOLUTION

From 9a0ba0412acee1c4fa82ef2ca74384559a42bf89 Mon Sep 17 00:00:00 2001 From: Ebrahim-Moqbel Date: Mon, 14 Sep 2026 23:07:51 +0100 Subject: [PATCH 15/29] Update comments to explain syntax error in 2.js Clarified explanation of the syntax error in the comments. --- Sprint-3/1-key-errors/2.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sprint-3/1-key-errors/2.js b/Sprint-3/1-key-errors/2.js index 93ffedaa3..2aeb4a2f5 100644 --- a/Sprint-3/1-key-errors/2.js +++ b/Sprint-3/1-key-errors/2.js @@ -14,7 +14,7 @@ // =============> explain this error message here /* The function was givin a number as its perameter where in JS only allows varaible names and usnig a number causes a SyntaxError - Also, the function was returning num*num where num is undefined causing a syntax error + Also, the function was returning num*num where num is undefined causing a SyntaxError */ // Finally, correct the code to fix the problem @@ -25,4 +25,4 @@ function square(num) { return num * num; } -console.log(square(25)); \ No newline at end of file +console.log(square(25)); From 34644004e0db0fd36d77ba13db3d9c97fa8fa511 Mon Sep 17 00:00:00 2001 From: Ebrahim_Moqbel Date: Mon, 14 Sep 2026 23:24:23 +0100 Subject: [PATCH 16/29] changed the consoled test cases for the toPounds function --- Sprint-3/3-mandatory-implement/3-to-pounds.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sprint-3/3-mandatory-implement/3-to-pounds.js b/Sprint-3/3-mandatory-implement/3-to-pounds.js index 6d6d0502c..0cca0f70f 100644 --- a/Sprint-3/3-mandatory-implement/3-to-pounds.js +++ b/Sprint-3/3-mandatory-implement/3-to-pounds.js @@ -23,5 +23,5 @@ const pence = paddedPenceNumberString console.log(toPounds('987p')); -console.log(toPounds('909p')); -console.log(toPounds('345p')); \ No newline at end of file +console.log(toPounds('9p')); +console.log(toPounds('50p')); \ No newline at end of file From 09bea6cfe35bcbdc9fb5ebb559d64d7940a536df Mon Sep 17 00:00:00 2001 From: Ebrahim_Moqbel Date: Mon, 14 Sep 2026 23:37:11 +0100 Subject: [PATCH 17/29] corrected my explanation of the returned and the pass value of pad --- 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 0c21d173c..584131cf3 100644 --- a/Sprint-3/4-mandatory-interpret/time-format.js +++ b/Sprint-3/4-mandatory-interpret/time-format.js @@ -27,7 +27,7 @@ console.log(formatTimeDisplay(61)); // 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 first time pad was called with 61 the value is 00:01:01 +// =============> the value is 0 as the first call for pad was with totalHours // c) What is the return value of pad is called for the first time? // =============> "00" @@ -38,4 +38,4 @@ console.log(formatTimeDisplay(61)); // e) What is the return value of pad when it is called for the last time in this program? Explain your answer // =============> 1 -// the return value is "1" but as we are using pad would be adding a leading of "0" to become "01" \ No newline at end of file +// the return value is 1 but as we are using pad would be adding a leading of 0 to become 01 \ No newline at end of file From c6401468d6965562d08f1ab4e3e438aa05b57d55 Mon Sep 17 00:00:00 2001 From: Ebrahim_Moqbel Date: Sun, 20 Sep 2026 14:33:39 +0100 Subject: [PATCH 18/29] deleted line 12 as it has been stated in line 17 --- Sprint-3/1-key-errors/0.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Sprint-3/1-key-errors/0.js b/Sprint-3/1-key-errors/0.js index 58c55ec50..f83fdd636 100644 --- a/Sprint-3/1-key-errors/0.js +++ b/Sprint-3/1-key-errors/0.js @@ -8,10 +8,6 @@ and will append the sliced string from index 1 which is the second letter // call the function capitalise with a string input // interpret the error message and figure out why an error is occurring - -/* syntax Error :identifier the variabel has already been declared. -As we can see the str variable has already been declared in the prameter of the function instead we just return the value */ - // function capitalise(str) { // let str = `${str[0].toUpperCase()}${str.slice(1)}`; // return str; From c6908db9329d41390709de192f181c230088ee63 Mon Sep 17 00:00:00 2001 From: Ebrahim_Moqbel Date: Sun, 20 Sep 2026 14:37:49 +0100 Subject: [PATCH 19/29] separated my explanation to the original task instruction line --- Sprint-3/1-key-errors/1.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Sprint-3/1-key-errors/1.js b/Sprint-3/1-key-errors/1.js index 8fafe081e..225521df8 100644 --- a/Sprint-3/1-key-errors/1.js +++ b/Sprint-3/1-key-errors/1.js @@ -20,7 +20,10 @@ and already is a local variable which can't be declared again causing a SyntaxError As the decimalNumber inside the function we can't print it using the console.log() as it has no power to the local scope instead we can delete the second declaration and just leave the parameter as an input for the user - Finally, correct the code to fix the problem */ +*/ + + +// Finally, correct the code to fix the problem // =============> write your new code here function convertToPercentage(decimalNumber) { From 2b628024076898631a8c850ac1c6000641d2b296 Mon Sep 17 00:00:00 2001 From: Ebrahim_Moqbel Date: Sun, 20 Sep 2026 14:48:35 +0100 Subject: [PATCH 20/29] consoled log the function and further explained my prediction and the results --- Sprint-3/2-mandatory-debug/0.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Sprint-3/2-mandatory-debug/0.js b/Sprint-3/2-mandatory-debug/0.js index 7c0c923d0..b39869422 100644 --- a/Sprint-3/2-mandatory-debug/0.js +++ b/Sprint-3/2-mandatory-debug/0.js @@ -1,7 +1,7 @@ // Predict and explain first... // =============> write your prediction here -// This function would multiply the two arguments a and b whatever that is +// This function would multiply the two arguments a and b // when we log the output we will get the string and the output of the function but because we are not returning an output we might run into an error // function multiply(a, b) { @@ -11,7 +11,8 @@ // console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`); // =============> write your explanation here -//The console.log() inside the funtion will print a*b but when we call the function will return undefined +//The console.log() inside the function will print a*b but when we call the function will return the out put and undefined +// but after the fix of returning instead it will be working giving the result in that instance will get 320 // Finally, correct the code to fix the problem // =============> write your new code here @@ -19,4 +20,6 @@ function multiply(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)}`); + +console.log(multiply(10,32)) \ No newline at end of file From f53975ceb6434a1c5a2658e07a5e0a944efca4da Mon Sep 17 00:00:00 2001 From: Ebrahim_Moqbel Date: Sun, 20 Sep 2026 14:57:51 +0100 Subject: [PATCH 21/29] refactored the calculateBMI to return a string instead of a number --- Sprint-3/3-mandatory-implement/1-bmi.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Sprint-3/3-mandatory-implement/1-bmi.js b/Sprint-3/3-mandatory-implement/1-bmi.js index fb2498599..a715e2a5a 100644 --- a/Sprint-3/3-mandatory-implement/1-bmi.js +++ b/Sprint-3/3-mandatory-implement/1-bmi.js @@ -6,17 +6,18 @@ // squaring your height: 1.73 x 1.73 = 2.99 // dividing 70 by 2.99 = 23.41 -// Your result will be displayed to 1 decimal place, for example 23.4. +// Your result will be displayed to 1 decimal place, for example '23.4'. // You will need to implement a function that calculates the BMI of someone based off their weight and height // Given someone's weight in kg and height in metres // Then when we call this function with the weight and height -// It should return their Body Mass Index to 1 decimal place +// It should return a string of their Body Mass Index to 1 decimal place function calculateBMI(weight, height) { let result = (weight/(height*height)); - return Number(result.toFixed(1)); + result= Number(result.toFixed(1)); + return String(result) } From e6fbc4fb28410360ead384d18e19817006e13c43 Mon Sep 17 00:00:00 2001 From: Ebrahim_Moqbel Date: Sun, 20 Sep 2026 15:00:21 +0100 Subject: [PATCH 22/29] added a semicolon in line 21 --- Sprint-3/3-mandatory-implement/3-to-pounds.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sprint-3/3-mandatory-implement/3-to-pounds.js b/Sprint-3/3-mandatory-implement/3-to-pounds.js index 0cca0f70f..489681589 100644 --- a/Sprint-3/3-mandatory-implement/3-to-pounds.js +++ b/Sprint-3/3-mandatory-implement/3-to-pounds.js @@ -18,7 +18,7 @@ const pounds = paddedPenceNumberString.substring( const pence = paddedPenceNumberString .substring(paddedPenceNumberString.length - 2) .padEnd(2, "0"); - return `£${pounds}.${pence}` + return `£${pounds}.${pence}`; } From 2eb14c0cde9b3e414034f17fc4ddb63ee9b8f68e Mon Sep 17 00:00:00 2001 From: Ebrahim_Moqbel Date: Sun, 20 Sep 2026 15:03:14 +0100 Subject: [PATCH 23/29] restored the original line of the task --- Sprint-3/4-mandatory-interpret/time-format.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sprint-3/4-mandatory-interpret/time-format.js b/Sprint-3/4-mandatory-interpret/time-format.js index 584131cf3..983ca1ca1 100644 --- a/Sprint-3/4-mandatory-interpret/time-format.js +++ b/Sprint-3/4-mandatory-interpret/time-format.js @@ -29,7 +29,7 @@ console.log(formatTimeDisplay(61)); // b) What is the value assigned to num when pad is called for the first time? // =============> the value is 0 as the first call for pad was with totalHours -// c) What is the return value of pad is called for the first time? +// c) What is the return value of pad when it is called for the first time? // =============> "00" // d) What is the value assigned to num when pad is called for the last time in this program? Explain your answer From aa32f0e9fe97a764d99e4bca3a443ddc4e595b48 Mon Sep 17 00:00:00 2001 From: Ebrahim_Moqbel Date: Mon, 21 Sep 2026 00:30:07 +0100 Subject: [PATCH 24/29] refactored calculateBMI --- Sprint-3/3-mandatory-implement/1-bmi.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Sprint-3/3-mandatory-implement/1-bmi.js b/Sprint-3/3-mandatory-implement/1-bmi.js index a715e2a5a..20a11c08f 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 result = (weight/(height*height)); - result= Number(result.toFixed(1)); + let result = (weight/(height*height)).toFixed(1); return String(result) } -console.log(calculateBMI(70,1.7)) -console.log(calculateBMI(72,1.7)) \ No newline at end of file +console.log(calculateBMI(81, 1.8)) From 064888114cf4a6e22f4180e32e3bfcdbe59f0df8 Mon Sep 17 00:00:00 2001 From: Ebrahim_Moqbel Date: Mon, 21 Sep 2026 00:31:32 +0100 Subject: [PATCH 25/29] deleting line 17 --- Sprint-3/1-key-errors/2.js | 1 - 1 file changed, 1 deletion(-) diff --git a/Sprint-3/1-key-errors/2.js b/Sprint-3/1-key-errors/2.js index 2aeb4a2f5..7b4e2ec8d 100644 --- a/Sprint-3/1-key-errors/2.js +++ b/Sprint-3/1-key-errors/2.js @@ -14,7 +14,6 @@ // =============> explain this error message here /* The function was givin a number as its perameter where in JS only allows varaible names and usnig a number causes a SyntaxError - Also, the function was returning num*num where num is undefined causing a SyntaxError */ // Finally, correct the code to fix the problem From b90242596849f7dbfc47343ac840177ec47ec768 Mon Sep 17 00:00:00 2001 From: Ebrahim_Moqbel Date: Mon, 21 Sep 2026 00:33:31 +0100 Subject: [PATCH 26/29] putting back the original version for the first line of the file 3-to-Pounds.js --- Sprint-3/3-mandatory-implement/3-to-pounds.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sprint-3/3-mandatory-implement/3-to-pounds.js b/Sprint-3/3-mandatory-implement/3-to-pounds.js index 489681589..637452aa4 100644 --- a/Sprint-3/3-mandatory-implement/3-to-pounds.js +++ b/Sprint-3/3-mandatory-implement/3-to-pounds.js @@ -1,4 +1,6 @@ -// In Sprint-1, there is a program written in interpret/to-pounds.js +// In Sprint-1, there is a program written in in 3-mandatory-interpret/3-to-pounds.js. + + // You will need to take this code and turn it into a reusable block of code. // You will need to declare a function called toPounds with an appropriately named parameter. From 38f5a356b531454bacdd2bfd06c4e9b0d4f8a1e6 Mon Sep 17 00:00:00 2001 From: Ebrahim_Moqbel Date: Mon, 21 Sep 2026 00:36:38 +0100 Subject: [PATCH 27/29] correcting my answer in line 40 for the time-format.js file --- Sprint-3/4-mandatory-interpret/time-format.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sprint-3/4-mandatory-interpret/time-format.js b/Sprint-3/4-mandatory-interpret/time-format.js index 983ca1ca1..49a6296f1 100644 --- a/Sprint-3/4-mandatory-interpret/time-format.js +++ b/Sprint-3/4-mandatory-interpret/time-format.js @@ -37,5 +37,5 @@ console.log(formatTimeDisplay(61)); // the last time, pad() is called with the remaining seconds which is value 1 // e) What is the return value of pad when it is called for the last time in this program? Explain your answer -// =============> 1 +// =============> 01 // the return value is 1 but as we are using pad would be adding a leading of 0 to become 01 \ No newline at end of file From df570d36a217996e0d4032ffc224665000808e01 Mon Sep 17 00:00:00 2001 From: Ebrahim_Moqbel Date: Mon, 21 Sep 2026 00:46:04 +0100 Subject: [PATCH 28/29] formatted all the files with prettier --- Sprint-3/1-key-errors/0.js | 5 +-- Sprint-3/1-key-errors/1.js | 5 +-- Sprint-3/2-mandatory-debug/0.js | 8 ++-- Sprint-3/2-mandatory-debug/1.js | 3 +- Sprint-3/2-mandatory-debug/2.js | 2 +- Sprint-3/3-mandatory-implement/1-bmi.js | 8 ++-- Sprint-3/3-mandatory-implement/2-cases.js | 2 +- Sprint-3/3-mandatory-implement/3-to-pounds.js | 37 +++++++++---------- Sprint-3/4-mandatory-interpret/time-format.js | 2 +- 9 files changed, 32 insertions(+), 40 deletions(-) diff --git a/Sprint-3/1-key-errors/0.js b/Sprint-3/1-key-errors/0.js index f83fdd636..63dce8967 100644 --- a/Sprint-3/1-key-errors/0.js +++ b/Sprint-3/1-key-errors/0.js @@ -19,8 +19,7 @@ As we can see the str variable has already been declared in the prameter of the // =============> write your new code here function capitalise(str) { - return str[0].toUpperCase()+str.slice(1); - + return str[0].toUpperCase() + str.slice(1); } console.log(capitalise("ebrahim")); -console.log(capitalise('salomi')); +console.log(capitalise("salomi")); diff --git a/Sprint-3/1-key-errors/1.js b/Sprint-3/1-key-errors/1.js index 225521df8..7ab9b7a9b 100644 --- a/Sprint-3/1-key-errors/1.js +++ b/Sprint-3/1-key-errors/1.js @@ -22,8 +22,7 @@ As the decimalNumber inside the function we can't print it using the console.log instead we can delete the second declaration and just leave the parameter as an input for the user */ - -// Finally, correct the code to fix the problem +// Finally, correct the code to fix the problem // =============> write your new code here function convertToPercentage(decimalNumber) { @@ -31,4 +30,4 @@ function convertToPercentage(decimalNumber) { return percentage; } -console.log(convertToPercentage(0.5)); \ No newline at end of file +console.log(convertToPercentage(0.5)); diff --git a/Sprint-3/2-mandatory-debug/0.js b/Sprint-3/2-mandatory-debug/0.js index b39869422..84bb75c2c 100644 --- a/Sprint-3/2-mandatory-debug/0.js +++ b/Sprint-3/2-mandatory-debug/0.js @@ -1,8 +1,8 @@ // Predict and explain first... // =============> write your prediction here -// This function would multiply the two arguments a and b -// when we log the output we will get the string and the output of the function but because we are not returning an output we might run into an error +// This function would multiply the two arguments a and b +// when we log the output we will get the string and the output of the function but because we are not returning an output we might run into an error // function multiply(a, b) { // console.log(a * b); @@ -11,7 +11,7 @@ // console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`); // =============> write your explanation here -//The console.log() inside the function will print a*b but when we call the function will return the out put and undefined +//The console.log() inside the function will print a*b but when we call the function will return the out put and undefined // but after the fix of returning instead it will be working giving the result in that instance will get 320 // Finally, correct the code to fix the problem @@ -22,4 +22,4 @@ function multiply(a, b) { console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`); -console.log(multiply(10,32)) \ No newline at end of file +console.log(multiply(10, 32)); diff --git a/Sprint-3/2-mandatory-debug/1.js b/Sprint-3/2-mandatory-debug/1.js index dab4d1cba..129a8e02a 100644 --- a/Sprint-3/2-mandatory-debug/1.js +++ b/Sprint-3/2-mandatory-debug/1.js @@ -2,7 +2,6 @@ // =============> write your prediction here // The function suppose to return the sum of the two variables but we will encounter an error as the code after return is unreachable. - // function sum(a, b) { // return; // a + b; @@ -20,4 +19,4 @@ function sum(a, b) { return a + b; } -console.log(`The sum of 10 and 32 is ${sum(10, 32)}`); \ No newline at end of file +console.log(`The sum of 10 and 32 is ${sum(10, 32)}`); diff --git a/Sprint-3/2-mandatory-debug/2.js b/Sprint-3/2-mandatory-debug/2.js index 9ad326b24..00396f326 100644 --- a/Sprint-3/2-mandatory-debug/2.js +++ b/Sprint-3/2-mandatory-debug/2.js @@ -42,4 +42,4 @@ console.log(`The last digit of 806 is ${getLastDigit(806)}`); /* the reason why getLastDigit isn't working properly is that it doesn't accept any arrguments where there isn't any perameters in its difination. where it uses the golabal varaible 'num' decalred outside the funtion and already set to 103 -The correct code includes a parameter 'num' in the difination this allows the function to accept the number passed to it when called*/ \ No newline at end of file +The correct code includes a parameter 'num' in the difination this allows the function to accept the number passed to it when called*/ diff --git a/Sprint-3/3-mandatory-implement/1-bmi.js b/Sprint-3/3-mandatory-implement/1-bmi.js index 20a11c08f..5dcea90a8 100644 --- a/Sprint-3/3-mandatory-implement/1-bmi.js +++ b/Sprint-3/3-mandatory-implement/1-bmi.js @@ -15,10 +15,8 @@ // It should return a string of their Body Mass Index to 1 decimal place function calculateBMI(weight, height) { - let result = (weight/(height*height)).toFixed(1); - return String(result) - - + let result = (weight / (height * height)).toFixed(1); + return String(result); } -console.log(calculateBMI(81, 1.8)) +console.log(calculateBMI(81, 1.8)); diff --git a/Sprint-3/3-mandatory-implement/2-cases.js b/Sprint-3/3-mandatory-implement/2-cases.js index ab8775b9b..ef1f25073 100644 --- a/Sprint-3/3-mandatory-implement/2-cases.js +++ b/Sprint-3/3-mandatory-implement/2-cases.js @@ -18,4 +18,4 @@ function toUpperSnakeCase(string) { return string.toUpperCase().replaceAll(" ", "_"); } console.log(toUpperSnakeCase("hello there")); -console.log(toUpperSnakeCase("lord of the rings")); \ No newline at end of file +console.log(toUpperSnakeCase("lord of the rings")); diff --git a/Sprint-3/3-mandatory-implement/3-to-pounds.js b/Sprint-3/3-mandatory-implement/3-to-pounds.js index 637452aa4..4f66f1b30 100644 --- a/Sprint-3/3-mandatory-implement/3-to-pounds.js +++ b/Sprint-3/3-mandatory-implement/3-to-pounds.js @@ -1,29 +1,26 @@ // In Sprint-1, there is a program written in in 3-mandatory-interpret/3-to-pounds.js. - - // You will need to take this code and turn it into a reusable block of code. // 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 -); +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"); + const pence = paddedPenceNumberString + .substring(paddedPenceNumberString.length - 2) + .padEnd(2, "0"); return `£${pounds}.${pence}`; - } - +} -console.log(toPounds('987p')); -console.log(toPounds('9p')); -console.log(toPounds('50p')); \ No newline at end of file +console.log(toPounds("987p")); +console.log(toPounds("9p")); +console.log(toPounds("50p")); diff --git a/Sprint-3/4-mandatory-interpret/time-format.js b/Sprint-3/4-mandatory-interpret/time-format.js index 49a6296f1..1638487a8 100644 --- a/Sprint-3/4-mandatory-interpret/time-format.js +++ b/Sprint-3/4-mandatory-interpret/time-format.js @@ -38,4 +38,4 @@ console.log(formatTimeDisplay(61)); // e) What is the return value of pad when it is called for the last time in this program? Explain your answer // =============> 01 -// the return value is 1 but as we are using pad would be adding a leading of 0 to become 01 \ No newline at end of file +// the return value is 1 but as we are using pad would be adding a leading of 0 to become 01 From 25fa3a3ea371c74c44b4ffc4cc0d641f66bca482 Mon Sep 17 00:00:00 2001 From: Ebrahim_Moqbel Date: Mon, 21 Sep 2026 00:47:21 +0100 Subject: [PATCH 29/29] deleting a line I used for testing --- Sprint-3/2-mandatory-debug/0.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/Sprint-3/2-mandatory-debug/0.js b/Sprint-3/2-mandatory-debug/0.js index 84bb75c2c..038526c09 100644 --- a/Sprint-3/2-mandatory-debug/0.js +++ b/Sprint-3/2-mandatory-debug/0.js @@ -21,5 +21,3 @@ function multiply(a, b) { } console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`); - -console.log(multiply(10, 32));