From 7916b12865285a6cc8f878eb02e71ab5e0c13c47 Mon Sep 17 00:00:00 2001 From: mandip sanger Date: Tue, 8 Sep 2026 17:47:01 +0100 Subject: [PATCH 01/18] key errors 1js --- Sprint-3/1-key-errors/1.js | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/Sprint-3/1-key-errors/1.js b/Sprint-3/1-key-errors/1.js index f2d56151f..bc1478768 100644 --- a/Sprint-3/1-key-errors/1.js +++ b/Sprint-3/1-key-errors/1.js @@ -1,20 +1,27 @@ // Predict and explain first... // Why will an error occur when this program runs? -// =============> write your prediction here - +// =============> write your prediction here decimalNumber has already been declared in the function. const can not redeclare a variable with the same name in the same scope. parameter, so we cannot declare it again with const. +// This will cause a syntax error. To fix this, we should remove the const keyword when assigning the new value to decimalNumber. +// console.log(decimalNumber); only exists inside the function. // Try playing computer with the example to work out what is going on -function convertToPercentage(decimalNumber) { - const decimalNumber = 0.5; - const percentage = `${decimalNumber * 100}%`; +//function convertToPercentage(decimalNumber) { +//const decimalNumber = 0.5; +//const percentage = `${decimalNumber * 100}%`; - return percentage; -} +//return percentage; +//} -console.log(decimalNumber); +//console.log(decimalNumber); // =============> write your explanation here // 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)); From 3f94fb8dda4dba6b50eb4b2ad1310586c834c6ac Mon Sep 17 00:00:00 2001 From: mandip sanger Date: Tue, 8 Sep 2026 17:48:08 +0100 Subject: [PATCH 02/18] key errot2 --- Sprint-3/1-key-errors/2.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Sprint-3/1-key-errors/2.js b/Sprint-3/1-key-errors/2.js index aad57f7cf..05966cbf8 100644 --- a/Sprint-3/1-key-errors/2.js +++ b/Sprint-3/1-key-errors/2.js @@ -1,20 +1,21 @@ - -// Predict and explain first BEFORE you run any code... +// SyntaxError: Unexpected token '3' // this function should square any number but instead we're going to get an error // =============> write your prediction of the error here -function square(3) { - return num * num; -} - -// =============> write the error message here +//function square(3) { +// return num * num; +//} +// =============> write the error message here SyntaxError: Unexpected token (1:16) // =============> explain this error message here // Finally, correct the code to fix the problem // =============> write your new code here +function square(num) { + return num * num; +} - +console.log(square(3)); From d63b3d38c616066dc28f5119faa3e483f75cf05b Mon Sep 17 00:00:00 2001 From: mandip sanger Date: Tue, 8 Sep 2026 17:49:29 +0100 Subject: [PATCH 03/18] manadatory debug 0.js --- Sprint-3/2-mandatory-debug/0.js | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/Sprint-3/2-mandatory-debug/0.js b/Sprint-3/2-mandatory-debug/0.js index b27511b41..d9bead1d7 100644 --- a/Sprint-3/2-mandatory-debug/0.js +++ b/Sprint-3/2-mandatory-debug/0.js @@ -1,14 +1,21 @@ -// Predict and explain first... +// Predict and explain first...didn't declare the a and b parameters in the function. This will cause a ReferenceError. To fix this, we should declare the parameters a and b in the function definition. -// =============> write your prediction here +// =============> write your prediction here function doesn't return anything, so the result of multiplying 10 and 32 is undefined. +// To fix this, we should add a return statement to the function to return the result of multiplying a and b. -function multiply(a, b) { - console.log(a * b); -} +//function multiply(a, b) { -console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`); +//console.log(a * b); +//} + +//console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`); -// =============> write your explanation here +// =============> The result of multiplying 10 and 32 is undefined'write your explanation here // 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)}`); From d449428f3e3bda6118febcacf73089e8334b8782 Mon Sep 17 00:00:00 2001 From: mandip sanger Date: Tue, 8 Sep 2026 17:50:26 +0100 Subject: [PATCH 04/18] manadatory debug 1.js --- Sprint-3/2-mandatory-debug/1.js | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/Sprint-3/2-mandatory-debug/1.js b/Sprint-3/2-mandatory-debug/1.js index 37cedfbcf..e6034d6b5 100644 --- a/Sprint-3/2-mandatory-debug/1.js +++ b/Sprint-3/2-mandatory-debug/1.js @@ -1,13 +1,19 @@ -// Predict and explain first... -// =============> write your prediction here +// Predict and explain first... function doesn't return anything, so the result of multiplying 10 and 32 is undefined. +// To fix this, we should add a return statement to the function to return the result of multiplying a and b. +// =============> write your prediction here 'The sum of 10 and 32 is undefined' -function sum(a, b) { - return; - a + b; -} +//function sum(a, b) { +//return; +//a + b; +//} -console.log(`The sum of 10 and 32 is ${sum(10, 32)}`); +//console.log(`The sum of 10 and 32 is ${sum(10, 32)}`); // =============> write your explanation here // Finally, correct the code to fix the problem // =============> write your new code here +function sum(a, b) { + return a + b; +} + +console.log(`The sum of 10 and 32 is ${sum(10, 32)}`); From 038f2d72dcbc5cebcd48903e13b9ccc4de01ab6f Mon Sep 17 00:00:00 2001 From: mandip sanger Date: Tue, 8 Sep 2026 17:51:04 +0100 Subject: [PATCH 05/18] debug 2.js --- Sprint-3/2-mandatory-debug/2.js | 34 ++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/Sprint-3/2-mandatory-debug/2.js b/Sprint-3/2-mandatory-debug/2.js index 57d3f5dc3..4fb2bba86 100644 --- a/Sprint-3/2-mandatory-debug/2.js +++ b/Sprint-3/2-mandatory-debug/2.js @@ -1,24 +1,36 @@ -// Predict and explain first... +// Predict and explain first...const num is declared outside the function, so it is not accessible inside the function. This will cause a ReferenceError. +// To fix this, we should pass the number as a parameter to the function and use that parameter inside the function. // Predict the output of the following code: -// =============> Write your prediction here +// =============> Write your prediction here 3,3,3 -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 +// =============> 2,5,6 // Explain why the output is the way it is -// =============> write your explanation here +// =============> the output is the way function is called with an argument, so the function is able to access the value of the argument passed to it and return the last digit of that number. +// The function is not using the variable num declared outside the function, so it does not cause a ReferenceError. // Finally, correct the code to fix the problem // =============> write your new code here // This program should tell the user the last digit of each number. // Explain why getLastDigit is not working properly - correct the problem + +const num = 103; + +function getLastDigit(n) { + return n.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)}`); From c35da0c17c457a7aab0d6905479b5e408efdc813 Mon Sep 17 00:00:00 2001 From: mandip sanger Date: Tue, 8 Sep 2026 17:52:07 +0100 Subject: [PATCH 06/18] implement bmi.js --- Sprint-3/3-mandatory-implement/1-bmi.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Sprint-3/3-mandatory-implement/1-bmi.js b/Sprint-3/3-mandatory-implement/1-bmi.js index 58b1085f1..a6d904835 100644 --- a/Sprint-3/3-mandatory-implement/1-bmi.js +++ b/Sprint-3/3-mandatory-implement/1-bmi.js @@ -6,14 +6,17 @@ // 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 + return (weight / (height * height)).toFixed(1); } +console.log(calculateBMI(90, 1.7)); +// return the BMI of someone based off their weight and height +// return the BMI of someone based off their weight and height From 06d8cbce942990480467b29f7c3c7d864a783d5c Mon Sep 17 00:00:00 2001 From: mandip sanger Date: Tue, 8 Sep 2026 17:52:46 +0100 Subject: [PATCH 07/18] implement case.js --- Sprint-3/3-mandatory-implement/2-cases.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Sprint-3/3-mandatory-implement/2-cases.js b/Sprint-3/3-mandatory-implement/2-cases.js index 5b0ef77ad..0258f93e9 100644 --- a/Sprint-3/3-mandatory-implement/2-cases.js +++ b/Sprint-3/3-mandatory-implement/2-cases.js @@ -14,3 +14,10 @@ // You will need to come up with an appropriate name for the function // Use the MDN string documentation to help you find a solution // This might help https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase +function convertToUpperSnakeCase(inputString) { + const captializedInputString = inputString.toUpperCase(); + const withUnderScore = captializedInputString.split(" ").join("_"); + return withUnderScore; +} + +console.log(convertToUpperSnakeCase("Hello there")); From c3d0e3aeb15f9cc7675432ce1877de46fd91da0f Mon Sep 17 00:00:00 2001 From: mandip sanger Date: Tue, 8 Sep 2026 17:53:34 +0100 Subject: [PATCH 08/18] implement topounds.js --- Sprint-3/3-mandatory-implement/3-to-pounds.js | 26 ++++++++++++++++++- 1 file changed, 25 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 10754da73..7e59a95d8 100644 --- a/Sprint-3/3-mandatory-implement/3-to-pounds.js +++ b/Sprint-3/3-mandatory-implement/3-to-pounds.js @@ -1,6 +1,30 @@ -// 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, + ); + + return `£${pounds}.${pence}`; +} + +console.log(toPounds("99p")); // £0.99 +console.log(toPounds("5p")); // £0.05 +console.log(toPounds("123p")); // £1.23 From 6ab0464c1ef154b839a0d02d19447e8f8a93d3f5 Mon Sep 17 00:00:00 2001 From: mandip sanger Date: Tue, 8 Sep 2026 17:54:34 +0100 Subject: [PATCH 09/18] interpret time-format.js --- Sprint-3/4-mandatory-interpret/time-format.js | 16 ++++++++++------ 1 file changed, 10 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..efdd82ed4 100644 --- a/Sprint-3/4-mandatory-interpret/time-format.js +++ b/Sprint-3/4-mandatory-interpret/time-format.js @@ -14,6 +14,7 @@ function formatTimeDisplay(seconds) { return `${pad(totalHours)}:${pad(remainingMinutes)}:${pad(remainingSeconds)}`; } +console.log(formatTimeDisplay(61)); // You will need to play computer with this example - use the Python Visualiser https://pythontutor.com/visualize.html#mode=edit // to help you answer these questions @@ -21,18 +22,21 @@ 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, once for each of the hours, minutes, and seconds values that are being formatted into a string. // 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 +// =============>Pad is called for the first time with the value of 0, which is the total hours calculated from the input of 61 seconds. +// The total hours is calculated by dividing the total minutes (1) by 60, which results in 0 hours. pad(totalHours) -// 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? +// =============> 0 is the value assigned to num when pad is called for the first time, and the return value of pad is "00". This is because the while loop in the pad function adds a leading zero to the string representation of num until its length is at least 2. Since num is 0, it becomes "00" after one iteration of the loop. // 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 +// =============> pad(remainingSeconds) remainingSeconds =1, so num is +1. This is because the input to formatTimeDisplay is 61 seconds, which results in 1 second remaining after calculating the total minutes and hours. The pad function is called with this value to format it as a two-digit string for display. // 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 +// =============> numString = "1" so string has only one character "01" the return value of pad when it is called for the last time in this program is "01". +// This is because the while loop in the pad function adds a leading zero to the string representation of num until its length is at least 2. +// Since num is 1, it becomes "01" after one iteration of the loop. From 468038bdf62884303463088b443a8507c74be3ee Mon Sep 17 00:00:00 2001 From: mandip sanger Date: Tue, 8 Sep 2026 17:57:20 +0100 Subject: [PATCH 10/18] wireframe --- Wireframe/index.html | 79 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 69 insertions(+), 10 deletions(-) diff --git a/Wireframe/index.html b/Wireframe/index.html index 0e014e535..ae5a9ec9f 100644 --- a/Wireframe/index.html +++ b/Wireframe/index.html @@ -1,4 +1,4 @@ - + @@ -10,24 +10,83 @@

Wireframe

- This is the default, provided code and no changes have been made yet. + Articles are a great way to share information and ideas with others. + They can be used to educate, inform, or entertain readers on a wide + range of topics. Whether you're writing about current events, + technology, health, or any other subject, articles provide a platform + for you to express your thoughts and insights. With the right research + and writing skills, you can create engaging and informative articles + that resonate with your audience and contribute to meaningful + discussions. .These articles have beeen selected to explain the purpose + of Read me file, Wireframe and Branch in Git.

- -

Title

+ Wireframe Design +

Purpose of Readme file

- Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam, - voluptates. Quisquam, voluptates. + The purpose of a README file is to serve as the primary guide and + quick-start manual for a project. Placed at the root of a folder or + repository, it explains what the project does, how to install and use + it, and how others can contribute.

- Read more + Read more +
+ +
+ Readme file example +

Purpose of Wireframe

+

+ A wireframe is a basic, two-dimensional visual representation of a web + page, app interface, or product layout. You can think of it as a + low-fidelity, functional sketch. Product designers and UX (user + experience) professionals draw up wireframes to communicate how they + plan to arrange and prioritize features, and how they intend for users + to interact with its product or website.Wireframes typically depict + only functionality, not the true style and visual elements of the + final product. It's why most wireframes look simple: grayscale instead + of colors, placeholders for images, and Lorem Ipsum for text. +

+ Read more +
+ +
+ Git Branch Visual Graph +

Purpose of Branch

+

+ Branches allow you to develop features, fix bugs, or safely experiment + with new ideas in a contained area of your repository. You always + create a branch from an existing branch. Typically, you might create a + new branch from the default branch of your repository. +

+ Read more
+
-

- This is the default, provided code and no changes have been made yet. -

+

Wifreframe project by Mandip Sanger

From c01d4cc1dc2827efb4d9df09b1673f197487b323 Mon Sep 17 00:00:00 2001 From: mandip sanger Date: Tue, 8 Sep 2026 17:58:12 +0100 Subject: [PATCH 11/18] style.css --- Wireframe/style.css | 105 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 99 insertions(+), 6 deletions(-) diff --git a/Wireframe/style.css b/Wireframe/style.css index aca09e1cc..91383d259 100644 --- a/Wireframe/style.css +++ b/Wireframe/style.css @@ -1,8 +1,101 @@ -/* - (Suggestion) Use a top-down approach when applying CSS: - 1. Lay out the top-level elements:
,
,