From df5f81783b58b98ff93aff432fd71f5f4807b70f Mon Sep 17 00:00:00 2001 From: Sima Date: Tue, 15 Sep 2026 20:12:59 +0200 Subject: [PATCH 01/27] created a new branch feature/form-controls --- Form-Controls/index.html | 49 +++++++++++++++++++++++++++++++++++----- 1 file changed, 43 insertions(+), 6 deletions(-) diff --git a/Form-Controls/index.html b/Form-Controls/index.html index 74b591ffc..22c0240ff 100644 --- a/Form-Controls/index.html +++ b/Form-Controls/index.html @@ -13,15 +13,52 @@

Product Pick

- - + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ +
From 48ae8515a516968aafdea0f297944b5664459cca Mon Sep 17 00:00:00 2001 From: Sima Date: Wed, 16 Sep 2026 12:59:15 +0200 Subject: [PATCH 02/27] edited the footer and added my name --- Form-Controls/index.html | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Form-Controls/index.html b/Form-Controls/index.html index 22c0240ff..197955613 100644 --- a/Form-Controls/index.html +++ b/Form-Controls/index.html @@ -13,19 +13,16 @@

Product Pick

-
-
-
-
-
@@ -58,7 +53,7 @@

Product Pick

-

By YOUR NAME

+

By Sima Nongawuza

From c31d05d25399d078a78719adf2b242fbc4282126 Mon Sep 17 00:00:00 2001 From: Sima Date: Wed, 16 Sep 2026 13:22:13 +0200 Subject: [PATCH 03/27] Added content in the form element --- Form-Controls/index.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Form-Controls/index.html b/Form-Controls/index.html index 197955613..9fc7fdb2d 100644 --- a/Form-Controls/index.html +++ b/Form-Controls/index.html @@ -27,8 +27,8 @@

Product Pick

@@ -52,7 +52,6 @@

Product Pick

-

By Sima Nongawuza

From ec0335407c67e4aa8dcffe5e0f5445a46985a98c Mon Sep 17 00:00:00 2001 From: Sima Date: Tue, 22 Sep 2026 13:19:01 +0200 Subject: [PATCH 04/27] created a javascript file --- prep/hello_world.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 prep/hello_world.js diff --git a/prep/hello_world.js b/prep/hello_world.js new file mode 100644 index 000000000..e69de29bb From e652c13cc9fa7bff2b3b5d5385ac8d4c8817006c Mon Sep 17 00:00:00 2001 From: Sima Date: Tue, 22 Sep 2026 13:42:14 +0200 Subject: [PATCH 05/27] Ran my first Hello world js --- prep/hello_world.js | 1 + 1 file changed, 1 insertion(+) diff --git a/prep/hello_world.js b/prep/hello_world.js index e69de29bb..592f78653 100644 --- a/prep/hello_world.js +++ b/prep/hello_world.js @@ -0,0 +1 @@ +console.log("Hello world"); \ No newline at end of file From 89f36e0dc457530d4ff981c51120634108d8740e Mon Sep 17 00:00:00 2001 From: Sima Date: Tue, 22 Sep 2026 13:54:00 +0200 Subject: [PATCH 06/27] Fuc fact about me --- prep/facts.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 prep/facts.js diff --git a/prep/facts.js b/prep/facts.js new file mode 100644 index 000000000..2953bc2dc --- /dev/null +++ b/prep/facts.js @@ -0,0 +1 @@ +console.log("I'm learning how to code because I want to combine my engineering background with technology.") \ No newline at end of file From 72b8724c046501a118ca895cbd4b530fe78e21c7 Mon Sep 17 00:00:00 2001 From: Sima Date: Tue, 22 Sep 2026 15:56:09 +0200 Subject: [PATCH 07/27] Declare and access variables --- prep/greeting.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 prep/greeting.js diff --git a/prep/greeting.js b/prep/greeting.js new file mode 100644 index 000000000..e69de29bb From a66fb77a0991289f46a88b9ea9d416913bf10664 Mon Sep 17 00:00:00 2001 From: Sima Date: Tue, 22 Sep 2026 16:19:41 +0200 Subject: [PATCH 08/27] Comparing variables --- prep/comparison.js | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 prep/comparison.js diff --git a/prep/comparison.js b/prep/comparison.js new file mode 100644 index 000000000..5eca7bef4 --- /dev/null +++ b/prep/comparison.js @@ -0,0 +1,2 @@ +console.log(42 === 10 + 30) +console.log(42 === 10 + 32) \ No newline at end of file From b0f2d1e89b095771e315bd886547f7a63a793d0f Mon Sep 17 00:00:00 2001 From: Sima Date: Wed, 23 Sep 2026 19:46:02 +0200 Subject: [PATCH 09/27] Explaining errors --- prep/passwordChecker.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 prep/passwordChecker.js diff --git a/prep/passwordChecker.js b/prep/passwordChecker.js new file mode 100644 index 000000000..807bcc23a --- /dev/null +++ b/prep/passwordChecker.js @@ -0,0 +1,21 @@ + +// const password = "secretword123"; +// const userInput = "secretword123"; +// if (userInput === password){ +// console.log("Correct password entered"); +// }else { +// console.log("Incorrect password entered") +//} + +// 2 Multiple outcomes +const password = "secretword123"; +const userInput = "override"; +const adminPassword = "override"; + +if (userInput === password){ + console.log("Correct password entered"); +} else if (userInput === adminPassword){ + console.log("Admin access granted") +}else { + console.log("Incorrect password!"); +} \ No newline at end of file From 8d227cdb3bd5cce6f49469de1b0ace118d4495e5 Mon Sep 17 00:00:00 2001 From: Sima Date: Wed, 23 Sep 2026 20:09:11 +0200 Subject: [PATCH 10/27] learning multiple possibilities for IF statements --- prep/comparison.js | 15 ++++++++++++++- prep/errors.js | 8 ++++++++ prep/greeting.js | 7 +++++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 prep/errors.js diff --git a/prep/comparison.js b/prep/comparison.js index 5eca7bef4..8d0157995 100644 --- a/prep/comparison.js +++ b/prep/comparison.js @@ -1,2 +1,15 @@ + +console.log(42 === 32 +10) console.log(42 === 10 + 30) -console.log(42 === 10 + 32) \ No newline at end of file + +console.log("hello" === "hello") + +console.log("CYF" === "cyf") + +const homeTown = "Newcastle" +homeTown === "Liverpool" +console.log(homeTown === homeTown) + +console.log(42 === 42) +// Loose equality +42 == "42" \ No newline at end of file diff --git a/prep/errors.js b/prep/errors.js new file mode 100644 index 000000000..aeeac36bb --- /dev/null +++ b/prep/errors.js @@ -0,0 +1,8 @@ +const volunteer = "Shadi"; +const volunteer = "Abdi"; +// Volunteer has already been declared in the first line, therefore it cannot be declared twice. +const volunteer = "Shadi"; +volunteer = "Hinde"; +// Volunteer is declared as a const so it cannot be changed. +console.log(Math.round(10.3)); +// No close bracket at the end of the console.log \ No newline at end of file diff --git a/prep/greeting.js b/prep/greeting.js index e69de29bb..15198427b 100644 --- a/prep/greeting.js +++ b/prep/greeting.js @@ -0,0 +1,7 @@ +const greeting = "Hello there"; +const name = "Sima" +console.log(`${greeting}, ${name}`); + +let greet = "Hi, how are you?" +greet = "Hey there" +console.log(greet) From b4c386be8ce6090819c47eb5f7fd183e6347cc04 Mon Sep 17 00:00:00 2001 From: Sima Date: Wed, 23 Sep 2026 20:27:57 +0200 Subject: [PATCH 11/27] created variable response "as the outcome" --- prep/passwordChecker.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/prep/passwordChecker.js b/prep/passwordChecker.js index 807bcc23a..84c0aff4c 100644 --- a/prep/passwordChecker.js +++ b/prep/passwordChecker.js @@ -9,13 +9,16 @@ // 2 Multiple outcomes const password = "secretword123"; -const userInput = "override"; +const userInput = "thisiswrong"; const adminPassword = "override"; +const response = ""; -if (userInput === password){ - console.log("Correct password entered"); +if (userInput === password){ + response = "Correct password entered"; } else if (userInput === adminPassword){ - console.log("Admin access granted") -}else { - console.log("Incorrect password!"); -} \ No newline at end of file + response = "Admin access granted"; +} else { + response = "Incorrect password!"; +} + +console.log(response); \ No newline at end of file From 127829d25a9591ee62498f0c0065e7365ab946a5 Mon Sep 17 00:00:00 2001 From: Sima Date: Wed, 23 Sep 2026 20:32:11 +0200 Subject: [PATCH 12/27] change response from const to let variable --- prep/passwordChecker.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/prep/passwordChecker.js b/prep/passwordChecker.js index 84c0aff4c..c34f336c0 100644 --- a/prep/passwordChecker.js +++ b/prep/passwordChecker.js @@ -9,9 +9,10 @@ // 2 Multiple outcomes const password = "secretword123"; -const userInput = "thisiswrong"; +const userInput = "secretword123"; const adminPassword = "override"; -const response = ""; +//Changed the const to let so that the response variable can be changed +let response = ""; if (userInput === password){ response = "Correct password entered"; From fbabe0345d9a33566d72b75dcbd62214406bef9e Mon Sep 17 00:00:00 2001 From: Sima Date: Thu, 24 Sep 2026 12:08:23 +0200 Subject: [PATCH 13/27] Explanation of incrementing a variables --- Sprint-2/1-key-exercises/1-count.js | 3 +++ prep/Module-JavaScript-Fundamentals | 1 + 2 files changed, 4 insertions(+) create mode 160000 prep/Module-JavaScript-Fundamentals diff --git a/Sprint-2/1-key-exercises/1-count.js b/Sprint-2/1-key-exercises/1-count.js index 117bcb2b6..133804580 100644 --- a/Sprint-2/1-key-exercises/1-count.js +++ b/Sprint-2/1-key-exercises/1-count.js @@ -4,3 +4,6 @@ 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 + +// ANSWER +// In line 3, the value of 1 is added to the inital value of count which was 0, therefore the count value is being increasing by one each time the code runs and saves the new result into the count variable. The assignment operator "=" runs the everuthing on the right side and then store the result in the variable on the left hand side. \ No newline at end of file diff --git a/prep/Module-JavaScript-Fundamentals b/prep/Module-JavaScript-Fundamentals new file mode 160000 index 000000000..d28242a93 --- /dev/null +++ b/prep/Module-JavaScript-Fundamentals @@ -0,0 +1 @@ +Subproject commit d28242a938d2c22e3cfcc74476e48046bed8a348 From a040e64fe665e8168f88a6f780b9173d5005a6f2 Mon Sep 17 00:00:00 2001 From: Sima Date: Thu, 24 Sep 2026 12:54:31 +0200 Subject: [PATCH 14/27] Declared initials variable to take 1st letters --- Sprint-2/1-key-exercises/2-initials.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Sprint-2/1-key-exercises/2-initials.js b/Sprint-2/1-key-exercises/2-initials.js index 964c9563c..51512e506 100644 --- a/Sprint-2/1-key-exercises/2-initials.js +++ b/Sprint-2/1-key-exercises/2-initials.js @@ -2,9 +2,5 @@ const firstName = "Creola"; const middleName = "Katherine"; const 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. - -const initials = ``; - -// https://www.google.com/search?q=get+first+character+of+string+mdn +const initials = `${firstName[0]}${middleName[0]}${lastName[0]}`; +console.log(initials); From 4c87f276b433071113e4221daddc479294fd9130 Mon Sep 17 00:00:00 2001 From: Sima Date: Thu, 24 Sep 2026 13:37:46 +0200 Subject: [PATCH 15/27] created string method to extract dir and ext from path --- Sprint-2/1-key-exercises/3-paths.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sprint-2/1-key-exercises/3-paths.js b/Sprint-2/1-key-exercises/3-paths.js index ab90ebb28..fbe113e0f 100644 --- a/Sprint-2/1-key-exercises/3-paths.js +++ b/Sprint-2/1-key-exercises/3-paths.js @@ -17,7 +17,7 @@ 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); +const ext = filePath.slice(filePath.lastIndexOf(".") + 1); // https://www.google.com/search?q=slice+mdn \ No newline at end of file From d39bec0c7c5ceff06b21e5d17aaa1521f6dd57d0 Mon Sep 17 00:00:00 2001 From: Sima Date: Thu, 24 Sep 2026 14:15:34 +0200 Subject: [PATCH 16/27] Explained evaluated how the expression works --- Sprint-2/1-key-exercises/4-random.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Sprint-2/1-key-exercises/4-random.js b/Sprint-2/1-key-exercises/4-random.js index 292f83aab..af98153cb 100644 --- a/Sprint-2/1-key-exercises/4-random.js +++ b/Sprint-2/1-key-exercises/4-random.js @@ -2,8 +2,14 @@ const minimum = 1; const maximum = 100; const num = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum; - +console.log(num) // In this exercise, you will need to work out what num represents? // 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 + +// ANSWER +// num represents a random whole number in the range 0 - 100. +// math.random gives a random decimal between 0 and 1.math floor rounds the value to a whole number. +// (maximum - minimum + 1) evaluates the total count of integers. (+ minimum )adds 1 to the outcome. +// The code starts by evaluating math.random then multiply that by the maximum, math.floor will then round that value into a whole number then finally adding minimum to get num. From 094f842babd391dafe10dab435291bbca07e4915 Mon Sep 17 00:00:00 2001 From: Sima Date: Thu, 24 Sep 2026 15:18:17 +0200 Subject: [PATCH 17/27] changed the const to let to allow reassigning --- Sprint-2/2-mandatory-errors/1.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sprint-2/2-mandatory-errors/1.js b/Sprint-2/2-mandatory-errors/1.js index 7a43cbea7..8c5e17a24 100644 --- a/Sprint-2/2-mandatory-errors/1.js +++ b/Sprint-2/2-mandatory-errors/1.js @@ -1,4 +1,5 @@ // trying to create an age variable and then reassign the value by 1 -const age = 33; +let age = 33; age = age + 1; +console.log(age); \ No newline at end of file From 2623dbd5543dceb94065ff2a2f10635067ffe70a Mon Sep 17 00:00:00 2001 From: Sima Date: Thu, 24 Sep 2026 15:29:04 +0200 Subject: [PATCH 18/27] Make the cityOfBirth the first line before the console.log --- Sprint-2/2-mandatory-errors/2.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Sprint-2/2-mandatory-errors/2.js b/Sprint-2/2-mandatory-errors/2.js index e09b89831..4cd3c244b 100644 --- a/Sprint-2/2-mandatory-errors/2.js +++ b/Sprint-2/2-mandatory-errors/2.js @@ -1,5 +1,8 @@ // 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}`); +//Answer +// The console.log will be execued first because it is before the declared city variable. + const cityOfBirth = "Bolton"; +console.log(`I was born in ${cityOfBirth}`); \ No newline at end of file From 72823456b709629a5cc9379ba4e359cba9ad028e Mon Sep 17 00:00:00 2001 From: Sima Date: Thu, 24 Sep 2026 16:13:48 +0200 Subject: [PATCH 19/27] Converted the number to a string before the slice method --- Sprint-2/2-mandatory-errors/3.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Sprint-2/2-mandatory-errors/3.js b/Sprint-2/2-mandatory-errors/3.js index ec101884d..2a43854ea 100644 --- a/Sprint-2/2-mandatory-errors/3.js +++ b/Sprint-2/2-mandatory-errors/3.js @@ -1,5 +1,6 @@ const cardNumber = 4533787178994213; -const last4Digits = cardNumber.slice(-4); +const last4Digits = String(cardNumber).slice(-4); +console.log(last4Digits); // The last4Digits variable should store the last 4 digits of cardNumber // However, the code isn't working @@ -7,3 +8,7 @@ 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 + +// Explanation +// The string slice method does not apply to number variables, therefore the code will not run. +// The number must be changed to a string first. \ No newline at end of file From a5ef8751ee2fa96f18165ec67e5769a1a5966040 Mon Sep 17 00:00:00 2001 From: Sima Date: Thu, 24 Sep 2026 16:31:18 +0200 Subject: [PATCH 20/27] Changed the variables from numbers not letters --- Sprint-2/2-mandatory-errors/4.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Sprint-2/2-mandatory-errors/4.js b/Sprint-2/2-mandatory-errors/4.js index 5f86c730b..a291d0245 100644 --- a/Sprint-2/2-mandatory-errors/4.js +++ b/Sprint-2/2-mandatory-errors/4.js @@ -1,2 +1,4 @@ -const 12HourClockTime = "8:53pm"; -const 24hourClockTime = "20:53"; +const twelveHourClockTime = "8:53pm"; +const twentyFourhourClockTime = "20:53"; + +// A variable name can not start with a number. \ No newline at end of file From 5b6ddbd50f7c47d3da77e7e7c1385504eb4ade17 Mon Sep 17 00:00:00 2001 From: Sima Date: Thu, 24 Sep 2026 17:18:13 +0200 Subject: [PATCH 21/27] corrected the error in line 5 --- Sprint-2/3-mandatory-interpret/1-percentage-change.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Sprint-2/3-mandatory-interpret/1-percentage-change.js b/Sprint-2/3-mandatory-interpret/1-percentage-change.js index e24ecb8e1..54bf5541b 100644 --- a/Sprint-2/3-mandatory-interpret/1-percentage-change.js +++ b/Sprint-2/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,18 @@ 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 +// line 4, number() and replaceAll() +// line 5, number() and replaceAll() +// 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 was a missing comma in line 5. // c) Identify all the lines that are variable reassignment statements +// line 4 and line 5 // d) Identify all 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 changes the string to a number and removes the comma. This makes it possible for Javascript to perform subtraction since it is no longer a string \ No newline at end of file From 4be47f2f5d93fe971b9ae6618183aa0073490445 Mon Sep 17 00:00:00 2001 From: Sima Date: Thu, 24 Sep 2026 17:44:10 +0200 Subject: [PATCH 22/27] Answered the questions --- Sprint-2/3-mandatory-interpret/2-time-format.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Sprint-2/3-mandatory-interpret/2-time-format.js b/Sprint-2/3-mandatory-interpret/2-time-format.js index 47d239558..1ade6eb77 100644 --- a/Sprint-2/3-mandatory-interpret/2-time-format.js +++ b/Sprint-2/3-mandatory-interpret/2-time-format.js @@ -12,14 +12,15 @@ 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? - +// 6, line1,3,4,6,7,9 // b) How many function calls are there? - +// 1, Line 10: console.log() // c) Using documentation, explain what the expression movieLength % 60 represents // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators - +// The modulo operator divides the movieLength in seconds by 60 and give the remainder // d) Interpret line 4, what does the expression assigned to totalMinutes mean? - +// It calculates the total number of whole minutes in the movie by subtracting the remainingSeconds from the total movie then divides the answer by 60 to covert seconds to minutes. // e) What do you think the variable result represents? Can you think of a better name for this variable? - +// This variable represents the movie duration in the form of hours:minutes:seconds. better name id duration. // f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer +// The code will run for all non negative whole number. \ No newline at end of file From 7d4af4e3b557905b136dab6b49a15c919a84344d Mon Sep 17 00:00:00 2001 From: Sima Date: Thu, 24 Sep 2026 18:57:58 +0200 Subject: [PATCH 23/27] Line by line explanation of the code --- Sprint-2/3-mandatory-interpret/3-to-pounds.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Sprint-2/3-mandatory-interpret/3-to-pounds.js b/Sprint-2/3-mandatory-interpret/3-to-pounds.js index 60c9ace69..a761864ab 100644 --- a/Sprint-2/3-mandatory-interpret/3-to-pounds.js +++ b/Sprint-2/3-mandatory-interpret/3-to-pounds.js @@ -25,3 +25,19 @@ console.log(`£${pounds}.${pence}`); // To begin, we can start with // 1. const penceString = "399p": initialises a string variable with the value "399p" +// 2. const penceStringWithoutTrailingP = penceString.substring( +// 0, +//penceString.length - 1 :Removes the letter p from the end of the string. +//); +// 3. const paddedPenceNumberString = penceStringWithoutTrailingP.padStart(3, "0"); : Makes sure that the string has at least 3 characters by adding zeros at the beginning if required. + +// // const pounds = paddedPenceNumberString.substring( +// 0, +// paddedPenceNumberString.length - 2 :This takes the first digit of the number in pence since 100 pence = 1 pound therefore coverting pence to pounds +// ); + +// const pence = paddedPenceNumberString +// .substring(paddedPenceNumberString.length - 2): Takes the pence which is the 2 numbers after the 1st number and ensures that it is exactly 2 digits long. +// .padEnd(2, "0"); + +// console.log(`£${pounds}.${pence}`); : Prints the final output string using the literal to combine currency symbol, pounds and the pence. \ No newline at end of file From 87f58659192850b1071f4b8637e0181e199b10af Mon Sep 17 00:00:00 2001 From: Sima Date: Fri, 25 Sep 2026 17:51:44 +0200 Subject: [PATCH 24/27] Input javaScript code into the chrome console practice --- Sprint-2/4-stretch-explore/chrome.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Sprint-2/4-stretch-explore/chrome.md b/Sprint-2/4-stretch-explore/chrome.md index 962580b82..063bbe91e 100644 --- a/Sprint-2/4-stretch-explore/chrome.md +++ b/Sprint-2/4-stretch-explore/chrome.md @@ -6,10 +6,14 @@ Just like the Node REPL, you can input JavaScript code into the Console tab and Let's try an example. In the Chrome console, invoke the function `alert` with one argument, the string `"Hello world!"`; - + What effect does calling the `alert` function have? +It created a pop up message in the broswer saying Hello world and an ok button. Now try invoking the function `prompt` with a string input of `"What is your name?"` - store the return value of your call to `prompt` in an variable called `myName`. What effect does calling the `prompt` function have? +It displays a pop up message in the browswer asking the user "What is your name?", it also inludes an OK and Cancel button + What is the return value of `prompt`? +I entered my Sima and clicked OK, so the return value is "Sima" which is stored as myName. \ No newline at end of file From 9d0e267406ec72b4d1d440cc008f4c40b71cb7db Mon Sep 17 00:00:00 2001 From: Sima Date: Sun, 27 Sep 2026 18:04:30 +0200 Subject: [PATCH 25/27] Explaing console.log uses and properties --- Sprint-2/4-stretch-explore/objects.md | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Sprint-2/4-stretch-explore/objects.md b/Sprint-2/4-stretch-explore/objects.md index 0216dee56..6d7a97d12 100644 --- a/Sprint-2/4-stretch-explore/objects.md +++ b/Sprint-2/4-stretch-explore/objects.md @@ -1,16 +1,19 @@ -## Objects - In this activity, we'll explore some additional concepts that you'll encounter in more depth later on in the course. -Open the Chrome devtools Console, type in `console.log` and then hit enter +Open the Chrome devtools Console, type in console.log and then hit enter What output do you get? +It gives the expression : ƒ log() { [native code] } -Now enter just `console` in the Console, what output do you get back? - -Try also entering `typeof console` +Now enter just console in the Console, what output do you get back? +It gives the expression: console {debug: ƒ, error: ƒ, info: ƒ, log: ƒ, warn: ƒ, …} with all the methods or functions that can be used for debugging. +Try also entering typeof console +It gives the string "object" Answer the following questions: -What does `console` store? -What does the syntax `console.log` or `console.assert` mean? In particular, what does the `.` mean? +What does console store? +It stores a list of methods that can used in the browser's developer tools. + +What does the syntax console.log or console.assert mean? In particular, what does the . mean? +Console.log means that you are accessing the log method of the console object. The dot (.) is called the member access operator or dot notation, it is used to access methods inside an object. it tells javascript to look inside the object on the left to get the method on the right. \ No newline at end of file From 3195b56e42b6cda2c2ab2c4dbb374f500966e87c Mon Sep 17 00:00:00 2001 From: Sima Date: Sun, 27 Sep 2026 19:22:04 +0200 Subject: [PATCH 26/27] Remove Sprint 1 Form-Control changes --- Form-Controls/index.html | 43 ++++++---------------------------------- 1 file changed, 6 insertions(+), 37 deletions(-) diff --git a/Form-Controls/index.html b/Form-Controls/index.html index 9fc7fdb2d..74b591ffc 100644 --- a/Form-Controls/index.html +++ b/Form-Controls/index.html @@ -13,46 +13,15 @@

Product Pick

-
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- -
+ +
-

By Sima Nongawuza

+ +

By HOMEWORK SOLUTION

From 4a49b921913cabb5278a80bae04a2f6b5b1699b8 Mon Sep 17 00:00:00 2001 From: Sima Date: Sun, 27 Sep 2026 20:27:01 +0200 Subject: [PATCH 27/27] accidental prep folder from PR --- prep/Module-JavaScript-Fundamentals | 1 - prep/comparison.js | 15 --------------- prep/errors.js | 8 -------- prep/facts.js | 1 - prep/greeting.js | 7 ------- prep/hello_world.js | 1 - prep/passwordChecker.js | 25 ------------------------- 7 files changed, 58 deletions(-) delete mode 160000 prep/Module-JavaScript-Fundamentals delete mode 100644 prep/comparison.js delete mode 100644 prep/errors.js delete mode 100644 prep/facts.js delete mode 100644 prep/greeting.js delete mode 100644 prep/hello_world.js delete mode 100644 prep/passwordChecker.js diff --git a/prep/Module-JavaScript-Fundamentals b/prep/Module-JavaScript-Fundamentals deleted file mode 160000 index d28242a93..000000000 --- a/prep/Module-JavaScript-Fundamentals +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d28242a938d2c22e3cfcc74476e48046bed8a348 diff --git a/prep/comparison.js b/prep/comparison.js deleted file mode 100644 index 8d0157995..000000000 --- a/prep/comparison.js +++ /dev/null @@ -1,15 +0,0 @@ - -console.log(42 === 32 +10) -console.log(42 === 10 + 30) - -console.log("hello" === "hello") - -console.log("CYF" === "cyf") - -const homeTown = "Newcastle" -homeTown === "Liverpool" -console.log(homeTown === homeTown) - -console.log(42 === 42) -// Loose equality -42 == "42" \ No newline at end of file diff --git a/prep/errors.js b/prep/errors.js deleted file mode 100644 index aeeac36bb..000000000 --- a/prep/errors.js +++ /dev/null @@ -1,8 +0,0 @@ -const volunteer = "Shadi"; -const volunteer = "Abdi"; -// Volunteer has already been declared in the first line, therefore it cannot be declared twice. -const volunteer = "Shadi"; -volunteer = "Hinde"; -// Volunteer is declared as a const so it cannot be changed. -console.log(Math.round(10.3)); -// No close bracket at the end of the console.log \ No newline at end of file diff --git a/prep/facts.js b/prep/facts.js deleted file mode 100644 index 2953bc2dc..000000000 --- a/prep/facts.js +++ /dev/null @@ -1 +0,0 @@ -console.log("I'm learning how to code because I want to combine my engineering background with technology.") \ No newline at end of file diff --git a/prep/greeting.js b/prep/greeting.js deleted file mode 100644 index 15198427b..000000000 --- a/prep/greeting.js +++ /dev/null @@ -1,7 +0,0 @@ -const greeting = "Hello there"; -const name = "Sima" -console.log(`${greeting}, ${name}`); - -let greet = "Hi, how are you?" -greet = "Hey there" -console.log(greet) diff --git a/prep/hello_world.js b/prep/hello_world.js deleted file mode 100644 index 592f78653..000000000 --- a/prep/hello_world.js +++ /dev/null @@ -1 +0,0 @@ -console.log("Hello world"); \ No newline at end of file diff --git a/prep/passwordChecker.js b/prep/passwordChecker.js deleted file mode 100644 index c34f336c0..000000000 --- a/prep/passwordChecker.js +++ /dev/null @@ -1,25 +0,0 @@ - -// const password = "secretword123"; -// const userInput = "secretword123"; -// if (userInput === password){ -// console.log("Correct password entered"); -// }else { -// console.log("Incorrect password entered") -//} - -// 2 Multiple outcomes -const password = "secretword123"; -const userInput = "secretword123"; -const adminPassword = "override"; -//Changed the const to let so that the response variable can be changed -let response = ""; - -if (userInput === password){ - response = "Correct password entered"; -} else if (userInput === adminPassword){ - response = "Admin access granted"; -} else { - response = "Incorrect password!"; -} - -console.log(response); \ No newline at end of file