From 4032809f46174d16847f875b0a4b74b29a2ac1f8 Mon Sep 17 00:00:00 2001 From: Ebrahim_Moqbel Date: Tue, 13 Jan 2026 16:42:23 +0000 Subject: [PATCH 01/14] 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/14] 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/14] 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/14] 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/14] 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/14] 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/14] 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/14] 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/14] 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/14] 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/14] 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/14] 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/14] 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 -
- - -
-
- - -
-
- - -
-
- - -
- - -
-
- -
-
+ + +