From 78c0e385d77913c318f1d9e6e57dde240edf56e9 Mon Sep 17 00:00:00 2001 From: ChinweP Date: Thu, 2 Jul 2026 01:12:31 +0100 Subject: [PATCH 01/15] Add error prediction, explanation and corrected code --- Sprint-2/1-key-errors/0.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Sprint-2/1-key-errors/0.js b/Sprint-2/1-key-errors/0.js index 653d6f5a07..9c817d2439 100644 --- a/Sprint-2/1-key-errors/0.js +++ b/Sprint-2/1-key-errors/0.js @@ -1,13 +1,21 @@ // Predict and explain first... // =============> write your prediction here +// I predict it will throw a SyntaxError because the variable 'str' has already being declared in the function parameter. And JavaScript will not allow it. // 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; } // =============> write your explanation here +/* it throws a SyntaxError: Identifier 'str' has already been declared because the function parameter 'str' is already a variable in the function scope. +The line `let str = ...` tries to create a new variable str in the same scope, which is not allowed in JavaScript. To fix this, we can either rename the parameter or the variable inside the function. */ + // =============> write your new code here +function capitalise(str) { + return str[0].toUpperCase() + str.slice(1); +} \ No newline at end of file From 9de35ad9cf2a38f6f5a4bdc740799881d8ea5a28 Mon Sep 17 00:00:00 2001 From: ChinweP Date: Fri, 3 Jul 2026 20:35:30 +0100 Subject: [PATCH 02/15] Add error prediction, explanation and corrected code --- Sprint-2/1-key-errors/1.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Sprint-2/1-key-errors/1.js b/Sprint-2/1-key-errors/1.js index f2d56151f4..0e75dfeede 100644 --- a/Sprint-2/1-key-errors/1.js +++ b/Sprint-2/1-key-errors/1.js @@ -2,6 +2,9 @@ // Why will an error occur when this program runs? // =============> write your prediction here +/* I predict that it will throw a SyntaxError because decimalNumber is declared twice inside the same function, +and JvaScript does not allow redeclaring a variable with const in the same scope. +It will also throw a ReferenceError because decimalNumber is logged outside the function, where it is not defined. */ // Try playing computer with the example to work out what is going on @@ -15,6 +18,16 @@ function convertToPercentage(decimalNumber) { console.log(decimalNumber); // =============> write your explanation here +/* The function receives decimalNumber as a parameter, so that variable already exists in the function scope. Declaring const decimalNumber = 0.5; +inside the function attempts to create a second variable with the same name, which causes a SyntaxError. Additionally, the console.log(decimalNumber) is outside the function, so JavaScript cannot +find a variable called decimalNumber in that scope, which causes a ReferenceError. */ // 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 c806d67ce400aac78fa1724b5660288d799173eb Mon Sep 17 00:00:00 2001 From: ChinweP Date: Fri, 3 Jul 2026 21:09:04 +0100 Subject: [PATCH 03/15] Add error prediction, explanation, and corrected code --- Sprint-2/1-key-errors/2.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Sprint-2/1-key-errors/2.js b/Sprint-2/1-key-errors/2.js index aad57f7cfe..f72f95e683 100644 --- a/Sprint-2/1-key-errors/2.js +++ b/Sprint-2/1-key-errors/2.js @@ -4,17 +4,27 @@ // this function should square any number but instead we're going to get an error // =============> write your prediction of the error here +/* I predict that it will throw a SyntaxError because the function parameter is written as 3, which is not a valid variable +name. Function parameters should be names (like num, x,) or any other valid identifier, not a number. */ function square(3) { return num * num; } + // =============> write the error message here +// SyntaxError: Unexpected number // =============> explain this error message here +/* The function is declared with 3 as its parameter, but JavaScript only allows variable names(identifiers) +in that position. Using a number causes a SyntaxError before the code is run. +Also, the function tries to t=return num * num, but num is not defined, which would cause a ReferenceError if the first error did not occur.*/ // Finally, correct the code to fix the problem // =============> write your new code here +function square(num) { + return num * num; +} - +console.log(square(25)); From f4815fe8138e398f52d2bead06df4ee0fc60a961 Mon Sep 17 00:00:00 2001 From: ChinweP Date: Fri, 3 Jul 2026 23:52:54 +0100 Subject: [PATCH 04/15] Add prediction, explanation, and corrected code for multiply() debug task --- Sprint-2/2-mandatory-debug/0.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Sprint-2/2-mandatory-debug/0.js b/Sprint-2/2-mandatory-debug/0.js index b27511b417..cdb039bf2a 100644 --- a/Sprint-2/2-mandatory-debug/0.js +++ b/Sprint-2/2-mandatory-debug/0.js @@ -1,6 +1,8 @@ // Predict and explain first... // =============> write your prediction here +/* The code will return "The result of multiplying 10 and 32 is undefined" because the function logs the result instead of returning it. +Multiply(10, 32) returns udefined, and that's what gets inserted into the template string. */ function multiply(a, b) { console.log(a * b); @@ -9,6 +11,15 @@ function multiply(a, b) { console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`); // =============> write your explanation here +/* Inside the function, console.log(a * b) prints the answer to the console, but the function does not return any value, so it returns undefined. +when we call multiply(10, 32) ,the function prints 320 to the console, but the return value of the function is undefined. +console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`); inserts the returned value, not the logged value. Since the function returns undefined, +the final output becomes "The result of multiplying 10 and 32 is 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)}`); From d91f9b24e63c7bf1e23d6f80dd4f62d3275653da Mon Sep 17 00:00:00 2001 From: ChinweP Date: Tue, 14 Jul 2026 20:45:14 +0100 Subject: [PATCH 05/15] Add prediction, explanation and corrected code for sum() debug task --- Sprint-2/2-mandatory-debug/1.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Sprint-2/2-mandatory-debug/1.js b/Sprint-2/2-mandatory-debug/1.js index 37cedfbcfd..7117097e10 100644 --- a/Sprint-2/2-mandatory-debug/1.js +++ b/Sprint-2/2-mandatory-debug/1.js @@ -1,5 +1,7 @@ // Predict and explain first... // =============> write your prediction here +/* Because the function has a return statement with nothing after it, the code will return: The sum of 10 and 32 is udefined. +The line a + b will never run because it comes after the return. */ function sum(a, b) { return; @@ -9,5 +11,14 @@ function sum(a, b) { console.log(`The sum of 10 and 32 is ${sum(10, 32)}`); // =============> write your explanation here +/* When JavaScript sees a return statement, it immediately stops the function. So the function exits before it ever reaches a + b. +Because nothing is returned, JavaScript returns undefined. The template string uses the returned value. The line: console.log(`The sum of 10 and 32 is ${sum(10, 32)}`); +inserts whatever the function returns. since the function returns undefined, the final output becomes: The sum of 10 and 32 is undefined. Even though a + b is written in the function, it returns undefined. */ + // 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 From a2c62d8c5fe308ffd23fda353761d8e2356e0f2c Mon Sep 17 00:00:00 2001 From: ChinweP Date: Wed, 15 Jul 2026 16:28:21 +0100 Subject: [PATCH 06/15] Fix getLastDigit function to use parameter instead of global variable --- Sprint-2/2-mandatory-debug/2.js | 42 +++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/Sprint-2/2-mandatory-debug/2.js b/Sprint-2/2-mandatory-debug/2.js index 57d3f5dc35..79b4eff043 100644 --- a/Sprint-2/2-mandatory-debug/2.js +++ b/Sprint-2/2-mandatory-debug/2.js @@ -2,6 +2,13 @@ // Predict the output of the following code: // =============> Write your prediction here +/* All the three lines will output the last digits of 103, which is "3". So the output will be: +The last digit of 42 is 3 +The last digit of 105 is 3 +The last digit of 806 is 3 + +This is because the function getLastDigit() does not use the number passed into it. +Instead, it is always uses the global variable 'num', which is 103. therefore, every call returns the last digit of 103. */ const num = 103; @@ -15,10 +22,45 @@ 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 output will be: +The last digit of 42 is 3 +The last digit of 105 is 3 +The last digit of 806 is 3 +*/ + + // Explain why the output is the way it is // =============> write your explanation here + +/* The function getLastDigit() is supposed to return the last digit of the number passed to it by the user. However, the function does not accept any parameters. +Even though the function is called with values like getLastDigit(42), getLastDigit(105), and getLastDigit(806), the argument is ignored because the function definition does not include a parameter. +Instead, the function always uses the global variable 'num', which is 103. +The last digit of 103 is "3", so every call returns "3" regardless of the number passed in. */ + + // Finally, correct the code to fix the problem // =============> write your new code here +function getLastDigit(number) { + return number.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 + +/* getLastDigit is not working properly because it does not accept any parameters in its definition. +As a result, it always uses the global variable 'num', which is set to 103, instead of using the number passed to it when called. +The correct code now includes a parameter 'number' in the function definition of getLastDigit(). +This allows the function to accept the number passed to it when called. + +Correct Output: +The last digit of 42 is 2 +The last digit of 105 is 5 +The last digit of 806 is 6 + */ \ No newline at end of file From 6e6c0059827e540148f96f02ec08b4868472dc3b Mon Sep 17 00:00:00 2001 From: ChinweP Date: Wed, 15 Jul 2026 19:41:17 +0100 Subject: [PATCH 07/15] Add BMI function using proper formula and one-decimal formatting --- Sprint-2/3-mandatory-implement/1-bmi.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sprint-2/3-mandatory-implement/1-bmi.js b/Sprint-2/3-mandatory-implement/1-bmi.js index 17b1cbde1b..ce8a867fb6 100644 --- a/Sprint-2/3-mandatory-implement/1-bmi.js +++ b/Sprint-2/3-mandatory-implement/1-bmi.js @@ -16,4 +16,6 @@ function calculateBMI(weight, height) { // return the BMI of someone based off their weight and height + const bmi = (weight / height **2); + return bmi.toFixed(1); } \ No newline at end of file From 138d0a2b6ac30310d84b03fe96dbb74f0ea4efe4 Mon Sep 17 00:00:00 2001 From: ChinweP Date: Wed, 15 Jul 2026 19:59:12 +0100 Subject: [PATCH 08/15] Check function works for calculateBMI --- Sprint-2/3-mandatory-implement/1-bmi.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sprint-2/3-mandatory-implement/1-bmi.js b/Sprint-2/3-mandatory-implement/1-bmi.js index ce8a867fb6..78d825aee7 100644 --- a/Sprint-2/3-mandatory-implement/1-bmi.js +++ b/Sprint-2/3-mandatory-implement/1-bmi.js @@ -18,4 +18,6 @@ function calculateBMI(weight, height) { // return the BMI of someone based off their weight and height const bmi = (weight / height **2); return bmi.toFixed(1); -} \ No newline at end of file +} + +console.log(calculateBMI(90, 1.80)); \ No newline at end of file From 0b95d7aed24889de2f17afff703eb0b7d98d2612 Mon Sep 17 00:00:00 2001 From: ChinweP Date: Wed, 15 Jul 2026 23:34:11 +0100 Subject: [PATCH 09/15] Implement function to convert strings into UPPER_SNAKE_CASE format --- Sprint-2/3-mandatory-implement/2-cases.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Sprint-2/3-mandatory-implement/2-cases.js b/Sprint-2/3-mandatory-implement/2-cases.js index 5b0ef77ad9..aeba1443a1 100644 --- a/Sprint-2/3-mandatory-implement/2-cases.js +++ b/Sprint-2/3-mandatory-implement/2-cases.js @@ -14,3 +14,11 @@ // 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(text) { + return text.toUpperCase().replaceAll(" ", "_"); +} + +console.log(toUpperSnakeCase("hello there")); +console.log(toUpperSnakeCase("lord of the rings")); +console.log(toUpperSnakeCase("javascript is challenging and fun")); \ No newline at end of file From 4403ed4468651de5469d23bcf6b4fff4cafc613e Mon Sep 17 00:00:00 2001 From: ChinweP Date: Wed, 22 Jul 2026 21:00:41 +0100 Subject: [PATCH 10/15] Add formatTimeDisplay(), played computer to answer questions --- Sprint-1/3-mandatory-interpret/3-to-pounds.js | 3 ++- Sprint-2/3-mandatory-implement/3-to-pounds.js | 16 ++++++++++++++++ Sprint-2/4-mandatory-interpret/time-format.js | 5 +++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/Sprint-1/3-mandatory-interpret/3-to-pounds.js b/Sprint-1/3-mandatory-interpret/3-to-pounds.js index 60c9ace69a..7fe2618190 100644 --- a/Sprint-1/3-mandatory-interpret/3-to-pounds.js +++ b/Sprint-1/3-mandatory-interpret/3-to-pounds.js @@ -10,7 +10,8 @@ const pounds = paddedPenceNumberString.substring( 0, paddedPenceNumberString.length - 2 ); - +console.log(paddedPenceNumberString); +console.log(pounds); const pence = paddedPenceNumberString .substring(paddedPenceNumberString.length - 2) .padEnd(2, "0"); diff --git a/Sprint-2/3-mandatory-implement/3-to-pounds.js b/Sprint-2/3-mandatory-implement/3-to-pounds.js index 6265a1a703..7916c23271 100644 --- a/Sprint-2/3-mandatory-implement/3-to-pounds.js +++ b/Sprint-2/3-mandatory-implement/3-to-pounds.js @@ -4,3 +4,19 @@ // 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("399p")); +console.log(toPounds("5p")); +console.log(toPounds("99p")); +console.log(toPounds("250p")); \ No newline at end of file diff --git a/Sprint-2/4-mandatory-interpret/time-format.js b/Sprint-2/4-mandatory-interpret/time-format.js index 17127bc01e..92fb7bf5ef 100644 --- a/Sprint-2/4-mandatory-interpret/time-format.js +++ b/Sprint-2/4-mandatory-interpret/time-format.js @@ -22,17 +22,22 @@ function formatTimeDisplay(seconds) { // 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 +// 0 // c) What is the return value of pad is called for the first time? // =============> write your answer here +// 00 // d) What is the value assigned to num when pad is called for the last time in this program? Explain your answer // =============> write your answer here +// The value assigned is "1" because remainingSeconds was calculated as 61 % 60, which equals 1, and that is passed into pad last. // 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 +// The return value is "01" because pad always ensures te output is atleast 2 characters long, so 1 becomes "01". From decced1c9fafbd2ee915f2acb2b5456e0f2f23b5 Mon Sep 17 00:00:00 2001 From: ChinweP Date: Thu, 23 Jul 2026 00:11:51 +0100 Subject: [PATCH 11/15] Improve time conversion logic and add full tests --- Sprint-2/5-stretch-extend/format-time.js | 61 ++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/Sprint-2/5-stretch-extend/format-time.js b/Sprint-2/5-stretch-extend/format-time.js index 32a32e66b8..3477d6ed9d 100644 --- a/Sprint-2/5-stretch-extend/format-time.js +++ b/Sprint-2/5-stretch-extend/format-time.js @@ -23,3 +23,64 @@ console.assert( currentOutput2 === targetOutput2, `current output: ${currentOutput2}, target output: ${targetOutput2}` ); + +// Midnight +console.assert( + formatAs12HourClock("00:00") === "12:00 am", + "00:00 should be 12:00 am" +); + +// Noon +console.assert( + formatAs12HourClock("12:00") === "12:00 pm", + "12:00 should be 12:00 pm" +); + +// Minutes included +console.assert( + formatAs12HourClock("14:45") === "2:45 pm", + "14:45 should be 2:45 pm" +); + +// Single-digit hour AM +console.assert( + formatAs12HourClock("09:30") === "9:30 am", + "09:30 should be 9:30 am" +); + +// Single-digit hour PM +console.assert( + formatAs12HourClock("13:05") === "1:05 pm", + "13:05 should be 1:05 pm" +); + +// Edge: 12:59 PM +console.assert( + formatAs12HourClock("12:59") === "12:59 pm", + "12:59 should be 12:59 pm" +); + +// Edge: 00:59 AM +console.assert( + formatAs12HourClock("00:59") === "12:59 am", + "00:59 should be 12:59 am" +); + +function formatAs12HourClock(time) { + const [hourStr, minuteStr] = time.split(":"); + let hours = Number(hourStr); + const minutes = minuteStr; + + let period = "am"; + + if (hours === 0) { + hours = 12; // midnight + } else if (hours === 12) { + period = "pm"; // noon + } else if (hours > 12) { + hours -= 12; + period = "pm"; + } + + return `${hours}:${minutes} ${period}`; +} \ No newline at end of file From 5e74926b319ebcc1214e63847bcc2e5e6cfc1bcd Mon Sep 17 00:00:00 2001 From: ChinweP Date: Thu, 23 Jul 2026 00:49:06 +0100 Subject: [PATCH 12/15] Add toPounds() utility and test with sample values --- Sprint-2/3-mandatory-implement/3-to-pounds.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sprint-2/3-mandatory-implement/3-to-pounds.js b/Sprint-2/3-mandatory-implement/3-to-pounds.js index 7916c23271..a30bd82819 100644 --- a/Sprint-2/3-mandatory-implement/3-to-pounds.js +++ b/Sprint-2/3-mandatory-implement/3-to-pounds.js @@ -19,4 +19,4 @@ function toPounds(penceString) { console.log(toPounds("399p")); console.log(toPounds("5p")); console.log(toPounds("99p")); -console.log(toPounds("250p")); \ No newline at end of file +console.log(toPounds("250p")) \ No newline at end of file From 5ef2c0c9d9de0320c494bbed88d1b57f76de8cec Mon Sep 17 00:00:00 2001 From: ChinweP Date: Thu, 23 Jul 2026 00:50:10 +0100 Subject: [PATCH 13/15] Add semi-colon to line 22 --- Sprint-2/3-mandatory-implement/3-to-pounds.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sprint-2/3-mandatory-implement/3-to-pounds.js b/Sprint-2/3-mandatory-implement/3-to-pounds.js index a30bd82819..7916c23271 100644 --- a/Sprint-2/3-mandatory-implement/3-to-pounds.js +++ b/Sprint-2/3-mandatory-implement/3-to-pounds.js @@ -19,4 +19,4 @@ function toPounds(penceString) { console.log(toPounds("399p")); console.log(toPounds("5p")); console.log(toPounds("99p")); -console.log(toPounds("250p")) \ No newline at end of file +console.log(toPounds("250p")); \ No newline at end of file From ee9be0aa6e922d5bab392172ebf572cae5434b80 Mon Sep 17 00:00:00 2001 From: ChinweP Date: Thu, 23 Jul 2026 01:19:09 +0100 Subject: [PATCH 14/15] Remove unintended Sprint-1 file from PR --- Sprint-1/3-mandatory-interpret/3-to-pounds.js | 28 ------------------- 1 file changed, 28 deletions(-) delete mode 100644 Sprint-1/3-mandatory-interpret/3-to-pounds.js diff --git a/Sprint-1/3-mandatory-interpret/3-to-pounds.js b/Sprint-1/3-mandatory-interpret/3-to-pounds.js deleted file mode 100644 index 7fe2618190..0000000000 --- a/Sprint-1/3-mandatory-interpret/3-to-pounds.js +++ /dev/null @@ -1,28 +0,0 @@ -const penceString = "399p"; - -const penceStringWithoutTrailingP = penceString.substring( - 0, - penceString.length - 1 -); - -const paddedPenceNumberString = penceStringWithoutTrailingP.padStart(3, "0"); -const pounds = paddedPenceNumberString.substring( - 0, - paddedPenceNumberString.length - 2 -); -console.log(paddedPenceNumberString); -console.log(pounds); -const pence = paddedPenceNumberString - .substring(paddedPenceNumberString.length - 2) - .padEnd(2, "0"); - -console.log(`£${pounds}.${pence}`); - -// This program takes a string representing a price in pence -// The program then builds up a string representing the price in pounds - -// You need to do a step-by-step breakdown of each line in this program -// Try and describe the purpose / rationale behind each step - -// To begin, we can start with -// 1. const penceString = "399p": initialises a string variable with the value "399p" From 5a3fe894e9903043656dd2eeee7339e98990a914 Mon Sep 17 00:00:00 2001 From: ChinweP Date: Thu, 23 Jul 2026 02:00:19 +0100 Subject: [PATCH 15/15] Sprint 2 - Module Structuring and Testing Data --- Sprint-1/3-mandatory-interpret/3-to-pounds.js | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Sprint-1/3-mandatory-interpret/3-to-pounds.js diff --git a/Sprint-1/3-mandatory-interpret/3-to-pounds.js b/Sprint-1/3-mandatory-interpret/3-to-pounds.js new file mode 100644 index 0000000000..60c9ace69a --- /dev/null +++ b/Sprint-1/3-mandatory-interpret/3-to-pounds.js @@ -0,0 +1,27 @@ +const penceString = "399p"; + +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"); + +console.log(`£${pounds}.${pence}`); + +// This program takes a string representing a price in pence +// The program then builds up a string representing the price in pounds + +// You need to do a step-by-step breakdown of each line in this program +// Try and describe the purpose / rationale behind each step + +// To begin, we can start with +// 1. const penceString = "399p": initialises a string variable with the value "399p"