From 3ee7d4344cdd9b506cc64f8702135e7acbd5c7d6 Mon Sep 17 00:00:00 2001 From: burhan-mustafa Date: Fri, 12 Jun 2026 14:20:53 +0100 Subject: [PATCH 01/11] javascript files for prep --- prep/error.js | 2 ++ prep/error2.js | 2 ++ prep/example.js | 1 + prep/exercise1.js | 11 +++++++++++ prep/exercise2.js | 11 +++++++++++ prep/function.js | 7 +++++++ prep/pence.js | 4 ++++ prep/perimeter.js | 7 +++++++ prep/prep_script.js | 8 ++++++++ prep/variable.js | 0 10 files changed, 53 insertions(+) create mode 100644 prep/error.js create mode 100644 prep/error2.js create mode 100644 prep/example.js create mode 100644 prep/exercise1.js create mode 100644 prep/exercise2.js create mode 100644 prep/function.js create mode 100644 prep/pence.js create mode 100644 prep/perimeter.js create mode 100644 prep/prep_script.js create mode 100644 prep/variable.js diff --git a/prep/error.js b/prep/error.js new file mode 100644 index 0000000000..05845aad60 --- /dev/null +++ b/prep/error.js @@ -0,0 +1,2 @@ +const volunteer = "Shadi"; +const volunteer = "Abdi"; diff --git a/prep/error2.js b/prep/error2.js new file mode 100644 index 0000000000..56a57057ce --- /dev/null +++ b/prep/error2.js @@ -0,0 +1,2 @@ +const volunteer = "Shadi"; +volunteer = "Hinde"; diff --git a/prep/example.js b/prep/example.js new file mode 100644 index 0000000000..3f13872550 --- /dev/null +++ b/prep/example.js @@ -0,0 +1 @@ +console.log("Hello there!"); diff --git a/prep/exercise1.js b/prep/exercise1.js new file mode 100644 index 0000000000..41846fd453 --- /dev/null +++ b/prep/exercise1.js @@ -0,0 +1,11 @@ +// Write a function that will calculate the area of a rectangle +// given it's width and height + +let width = 3; +let height = 4; + +function calculateArea() { + return (area = width * height); +} + +console.log(calculateArea()); diff --git a/prep/exercise2.js b/prep/exercise2.js new file mode 100644 index 0000000000..535f793441 --- /dev/null +++ b/prep/exercise2.js @@ -0,0 +1,11 @@ +function capitaliseFirstLetter(name) { + console.log(name[0].toUpperCase() + name.substring(1)); +} + +function createGreeting(name) { + const result = capitaliseFirstLetter(name); + return `Welcome ${result}`; +} + +const greeting = createGreeting("barath"); +console.log(greeting); diff --git a/prep/function.js b/prep/function.js new file mode 100644 index 0000000000..d7ab875ed2 --- /dev/null +++ b/prep/function.js @@ -0,0 +1,7 @@ +const decimalToPercentage = 0.5; + +function convertToPercentage() { + const percentage = decimalToPercentage * 100; + console.log(`The percentage is ${percentage}%.`); +} +convertToPercentage(); diff --git a/prep/pence.js b/prep/pence.js new file mode 100644 index 0000000000..d17161716d --- /dev/null +++ b/prep/pence.js @@ -0,0 +1,4 @@ +const price = 10; // Just an example value. Try changing this value to 0, 10, or 1521, and make sure you still get the right answer from your code. +const pound = price / 100; + +console.log(`The price in pounds is £${pound}.`); diff --git a/prep/perimeter.js b/prep/perimeter.js new file mode 100644 index 0000000000..a6c51048ab --- /dev/null +++ b/prep/perimeter.js @@ -0,0 +1,7 @@ +const height = 10; // 10 is just an example of a value here - your code should still work if you change this to another value. +const width = 30; // Also just an example - your code should still work if this changes. +const area = height * width; +const perimeter = 2 * (height + width); + +console.log(`The area of the rectangle is ${area}.`); +console.log(`The perimeter of the rectangle is ${perimeter}.`); diff --git a/prep/prep_script.js b/prep/prep_script.js new file mode 100644 index 0000000000..de219d355b --- /dev/null +++ b/prep/prep_script.js @@ -0,0 +1,8 @@ +const yearOfBirth = 1990; // declaration +let currentYear = 2023; // declaration + +currentYear++; // statement +`I am ${currentYear - yearOfBirth} years old`; // statement + +console.log(`I was born in ${yearOfBirth}`); // statement +console.log(`The current year is ${currentYear}`); // statement diff --git a/prep/variable.js b/prep/variable.js new file mode 100644 index 0000000000..e69de29bb2 From 733c53ef678ec6f03b9c4ee0efa06970b941a54d Mon Sep 17 00:00:00 2001 From: burhan-mustafa Date: Fri, 12 Jun 2026 15:24:40 +0100 Subject: [PATCH 02/11] last change to prep exercise2.js --- prep/exercise2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prep/exercise2.js b/prep/exercise2.js index 535f793441..b95db75fc8 100644 --- a/prep/exercise2.js +++ b/prep/exercise2.js @@ -1,5 +1,5 @@ function capitaliseFirstLetter(name) { - console.log(name[0].toUpperCase() + name.substring(1)); + return name[0].toUpperCase() + name.substring(1); } function createGreeting(name) { From 84d4de9607a6a3f35cb60a7aada3f876c6780a2f Mon Sep 17 00:00:00 2001 From: burhan-mustafa Date: Fri, 12 Jun 2026 20:08:42 +0100 Subject: [PATCH 03/11] completed exercises 1 and 2 of section 1 --- Sprint-1/1-key-exercises/1-count.js | 4 ++++ Sprint-1/1-key-exercises/2-initials.js | 5 ++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Sprint-1/1-key-exercises/1-count.js b/Sprint-1/1-key-exercises/1-count.js index 117bcb2b6e..7b9b68cf16 100644 --- a/Sprint-1/1-key-exercises/1-count.js +++ b/Sprint-1/1-key-exercises/1-count.js @@ -4,3 +4,7 @@ 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: Line 3 is updating the value of the count variable by 1 to the current value of count. +// The = operator reassigns the value of count to be equal to (count + 1), which is the current value of count plus 1. +//This creates a counter that always increases by an increment of 1. diff --git a/Sprint-1/1-key-exercises/2-initials.js b/Sprint-1/1-key-exercises/2-initials.js index 47561f6175..350d743f92 100644 --- a/Sprint-1/1-key-exercises/2-initials.js +++ b/Sprint-1/1-key-exercises/2-initials.js @@ -5,7 +5,6 @@ let 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. -let initials = ``; - +let initials = firstName[0] + middleName[0] + lastName[0]; +console.log("The initials are:", initials); // https://www.google.com/search?q=get+first+character+of+string+mdn - From 5957240eef25d54b71b0f0c8dcfb9f179a89949d Mon Sep 17 00:00:00 2001 From: burhan-mustafa Date: Fri, 12 Jun 2026 22:12:05 +0100 Subject: [PATCH 04/11] completed task 3 --- Sprint-1/1-key-exercises/2-initials.js | 3 ++- Sprint-1/1-key-exercises/3-paths.js | 10 +++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Sprint-1/1-key-exercises/2-initials.js b/Sprint-1/1-key-exercises/2-initials.js index 350d743f92..32761fab03 100644 --- a/Sprint-1/1-key-exercises/2-initials.js +++ b/Sprint-1/1-key-exercises/2-initials.js @@ -6,5 +6,6 @@ let lastName = "Johnson"; // This should produce the string "CKJ", but you must not write the characters C, K, or J in the code of your solution. let initials = firstName[0] + middleName[0] + lastName[0]; -console.log("The initials are:", initials); +console.log("The initials are", initials); + // https://www.google.com/search?q=get+first+character+of+string+mdn diff --git a/Sprint-1/1-key-exercises/3-paths.js b/Sprint-1/1-key-exercises/3-paths.js index ab90ebb28e..8afc5f15d4 100644 --- a/Sprint-1/1-key-exercises/3-paths.js +++ b/Sprint-1/1-key-exercises/3-paths.js @@ -17,7 +17,11 @@ 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 lastDotIndex = filePath.lastIndexOf("."); +const firstSlashIndex = filePath.indexOf("/"); +const dir = filePath.slice(firstSlashIndex, lastSlashIndex); +const ext = filePath.slice(lastDotIndex); +console.log("The directory is: ${ext}"); +console.log(dir); -// https://www.google.com/search?q=slice+mdn \ No newline at end of file +// https://www.google.com/search?q=slice+mdn From 06435e4fd3a901d125973198ab7c15c1d15926bf Mon Sep 17 00:00:00 2001 From: burhan-mustafa Date: Fri, 12 Jun 2026 22:18:12 +0100 Subject: [PATCH 05/11] realised there was no backticks in console.log --- Sprint-1/1-key-exercises/3-paths.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sprint-1/1-key-exercises/3-paths.js b/Sprint-1/1-key-exercises/3-paths.js index 8afc5f15d4..8180655a09 100644 --- a/Sprint-1/1-key-exercises/3-paths.js +++ b/Sprint-1/1-key-exercises/3-paths.js @@ -21,7 +21,7 @@ const lastDotIndex = filePath.lastIndexOf("."); const firstSlashIndex = filePath.indexOf("/"); const dir = filePath.slice(firstSlashIndex, lastSlashIndex); const ext = filePath.slice(lastDotIndex); -console.log("The directory is: ${ext}"); -console.log(dir); +console.log(`The directory is ${dir}`); +console.log(`The ext is ${ext}`); // https://www.google.com/search?q=slice+mdn From 5b089054d02299db0a826bf6543f9eabac4a66e8 Mon Sep 17 00:00:00 2001 From: burhan-mustafa Date: Fri, 12 Jun 2026 23:14:35 +0100 Subject: [PATCH 06/11] section 1 is now complete and section 2 task 1 is complete --- Sprint-1/1-key-exercises/4-random.js | 2 ++ Sprint-1/2-mandatory-errors/0.js | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Sprint-1/1-key-exercises/4-random.js b/Sprint-1/1-key-exercises/4-random.js index 292f83aabb..cc98cbe4f5 100644 --- a/Sprint-1/1-key-exercises/4-random.js +++ b/Sprint-1/1-key-exercises/4-random.js @@ -7,3 +7,5 @@ const num = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum; // 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: Firstly a random number that is > or = to = 0 BUT less than 1 is generated, that number is multiplied a 100 and then always rounded down to the nearest whole number and then the minimum value of 1 is added diff --git a/Sprint-1/2-mandatory-errors/0.js b/Sprint-1/2-mandatory-errors/0.js index cf6c5039f7..e6b744a05b 100644 --- a/Sprint-1/2-mandatory-errors/0.js +++ b/Sprint-1/2-mandatory-errors/0.js @@ -1,2 +1,2 @@ -This is just an instruction for the first activity - but it is just for human consumption -We don't want the computer to run these 2 lines - how can we solve this problem? \ No newline at end of file +//This is just an instruction for the first activity - but it is just for human consumption +//We don't want the computer to run these 2 lines - how can we solve this problem? From c921f4a99a22cd18001d4833dfca8c8f316804bc Mon Sep 17 00:00:00 2001 From: burhan-mustafa Date: Fri, 12 Jun 2026 23:31:43 +0100 Subject: [PATCH 07/11] sprint 2 exercises 1 & 2 completed --- Sprint-1/2-mandatory-errors/1.js | 4 +++- Sprint-1/2-mandatory-errors/2.js | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Sprint-1/2-mandatory-errors/1.js b/Sprint-1/2-mandatory-errors/1.js index 7a43cbea76..72a742823e 100644 --- a/Sprint-1/2-mandatory-errors/1.js +++ b/Sprint-1/2-mandatory-errors/1.js @@ -1,4 +1,6 @@ // trying to create an age variable and then reassign the value by 1 -const age = 33; +var age = 33; age = age + 1; + +console.log(age); diff --git a/Sprint-1/2-mandatory-errors/2.js b/Sprint-1/2-mandatory-errors/2.js index e09b89831d..ed331ccc78 100644 --- a/Sprint-1/2-mandatory-errors/2.js +++ b/Sprint-1/2-mandatory-errors/2.js @@ -1,5 +1,6 @@ // Currently trying to print the string "I was born in Bolton" but it isn't working... // what's the error ? +// We were trying to call a the variable before it was even initialized / made. -console.log(`I was born in ${cityOfBirth}`); const cityOfBirth = "Bolton"; +console.log(`I was born in ${cityOfBirth}`); From b9828e47d43ea38ee0df77f7e238db7bbcfdce68 Mon Sep 17 00:00:00 2001 From: burhan-mustafa Date: Fri, 12 Jun 2026 23:48:20 +0100 Subject: [PATCH 08/11] Sprint 2 Tasks 3 & 4 complete --- Sprint-1/2-mandatory-errors/3.js | 4 ++-- Sprint-1/2-mandatory-errors/4.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Sprint-1/2-mandatory-errors/3.js b/Sprint-1/2-mandatory-errors/3.js index ec101884db..ab4ae9f656 100644 --- a/Sprint-1/2-mandatory-errors/3.js +++ b/Sprint-1/2-mandatory-errors/3.js @@ -1,6 +1,6 @@ -const cardNumber = 4533787178994213; +const cardNumber = "4533787178994213"; const last4Digits = cardNumber.slice(-4); - +console.log(last4Digits); // The last4Digits variable should store the last 4 digits of cardNumber // However, the code isn't working // Before running the code, make and explain a prediction about why the code won't work diff --git a/Sprint-1/2-mandatory-errors/4.js b/Sprint-1/2-mandatory-errors/4.js index 5f86c730bc..ce0e700721 100644 --- a/Sprint-1/2-mandatory-errors/4.js +++ b/Sprint-1/2-mandatory-errors/4.js @@ -1,2 +1,2 @@ -const 12HourClockTime = "8:53pm"; -const 24hourClockTime = "20:53"; +const CivilTime = "8:53pm"; +const ContinentalTime = "20:53"; From 7e158fa10ab989078d60513bb5d1a04f7ac5f5ff Mon Sep 17 00:00:00 2001 From: burhan-mustafa Date: Tue, 16 Jun 2026 17:20:01 +0100 Subject: [PATCH 09/11] All exercises in 3-mandatory-interpret completed --- .../1-percentage-change.js | 11 ++++++----- .../3-mandatory-interpret/2-time-format.js | 15 ++++++++------- Sprint-1/3-mandatory-interpret/3-to-pounds.js | 19 +++++++++++++++++++ 3 files changed, 33 insertions(+), 12 deletions(-) diff --git a/Sprint-1/3-mandatory-interpret/1-percentage-change.js b/Sprint-1/3-mandatory-interpret/1-percentage-change.js index e24ecb8e18..5b7a2083e8 100644 --- a/Sprint-1/3-mandatory-interpret/1-percentage-change.js +++ b/Sprint-1/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,12 @@ 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 - +// Answer: There are 5 function calls on lines 4, 5 and 10 // 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? - +// Answer: line 5 there is a comma missing in the replaceAll parameters. // c) Identify all the lines that are variable reassignment statements - +// Answer: Lines 4 and 5 // d) Identify all the lines that are variable declarations - +// Answer: Lines 1, 2, 7 and 8 // e) Describe what the expression Number(carPrice.replaceAll(",","")) is doing - what is the purpose of this expression? +// Answer: It removes all the commas from the string carPrice and turns it into a number that can be used in calculations diff --git a/Sprint-1/3-mandatory-interpret/2-time-format.js b/Sprint-1/3-mandatory-interpret/2-time-format.js index 47d2395587..3f2e38e640 100644 --- a/Sprint-1/3-mandatory-interpret/2-time-format.js +++ b/Sprint-1/3-mandatory-interpret/2-time-format.js @@ -1,4 +1,4 @@ -const movieLength = 8784; // length of movie in seconds +const movieLength = "839f"; // length of movie in seconds const remainingSeconds = movieLength % 60; const totalMinutes = (movieLength - remainingSeconds) / 60; @@ -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? - +// Answer: There is 6 variable declarations // b) How many function calls are there? - +// Answer: There is one function call on line 10 // c) Using documentation, explain what the expression movieLength % 60 represents // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators - +// Answer: this finds the remainder of movieLength when its divided by 60 // d) Interpret line 4, what does the expression assigned to totalMinutes mean? - -// e) What do you think the variable result represents? Can you think of a better name for this variable? - +// Answer: The expressions uses the modulo function to work out the remainder value which in this case works out the remaining seconds of the total movie length // f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer +// Answer: No it only works as intended when a Non negative integer is used however when Decimal, negative, or string values it does not work as intended. +// Decimal values will display decimal seconds, which does not cause an error, but the output may not be in the expected time format. +// Negative values will produce negative time values, and string values may produce NaN if they cannot be converted into a number. diff --git a/Sprint-1/3-mandatory-interpret/3-to-pounds.js b/Sprint-1/3-mandatory-interpret/3-to-pounds.js index 60c9ace69a..2f612bd6e0 100644 --- a/Sprint-1/3-mandatory-interpret/3-to-pounds.js +++ b/Sprint-1/3-mandatory-interpret/3-to-pounds.js @@ -25,3 +25,22 @@ console.log(`£${pounds}.${pence}`); // To begin, we can start with // 1. const penceString = "399p": initialises a string variable with the value "399p" + +// 3–6. const penceStringWithoutTrailingP takes the initial constant variable with the value of "399p" and uses the substring function to make a new string +// without the "p". It uses the .length property to return the number of characters in the string and subtracts 1 so that substring stops before the last +// character, which will always remove the "p". + +// 8. the next variable paddedPenceNumberString takes the previous string which only has number characters and checks if it is made up of three characters if it is not it +// is padded with "0" at the start of the string till there are three characters the reason for this is the minimum amount of characters needed to represent pounds and +// pence can be represented by is 3. + +//// 9-12. The next variable pounds takes the previous variable paddedPenceNumberString and uses the substring function to create a new string without the last +// two characters. It uses .length - 2 to stop before the final two characters because those characters represent the pence leaving only the characters +// that represent the pounds. + +// 14-16. The next variable pence takes paddedPenceNumberString and uses the substring function starting from two characters before the end of the string. +// This creates a new string containing only the final two characters which represent the pence. The padEnd function then adds "0" to the end of the +// string until it contains two characters making sure that the pence is always displayed using two digits. + +// 18. The console.log uses a template literal to combine the pound sign with the pounds and pence variables. A decimal point is placed between the two +// variables so that the final value is displayed as a price in pounds, for example "£3.99". From 44189f3b5bf8935b83cf96659e6f925d8dc026e2 Mon Sep 17 00:00:00 2001 From: burhan-mustafa Date: Tue, 16 Jun 2026 17:34:18 +0100 Subject: [PATCH 10/11] just some formatting changes --- Sprint-1/2-mandatory-errors/0.js | 4 ++-- Sprint-1/3-mandatory-interpret/3-to-pounds.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Sprint-1/2-mandatory-errors/0.js b/Sprint-1/2-mandatory-errors/0.js index e6b744a05b..044add7ac1 100644 --- a/Sprint-1/2-mandatory-errors/0.js +++ b/Sprint-1/2-mandatory-errors/0.js @@ -1,2 +1,2 @@ -//This is just an instruction for the first activity - but it is just for human consumption -//We don't want the computer to run these 2 lines - how can we solve this problem? +// This is just an instruction for the first activity - but it is just for human consumption +// We don't want the computer to run these 2 lines - how can we solve this problem? diff --git a/Sprint-1/3-mandatory-interpret/3-to-pounds.js b/Sprint-1/3-mandatory-interpret/3-to-pounds.js index 2f612bd6e0..b99e57bb26 100644 --- a/Sprint-1/3-mandatory-interpret/3-to-pounds.js +++ b/Sprint-1/3-mandatory-interpret/3-to-pounds.js @@ -34,7 +34,7 @@ console.log(`£${pounds}.${pence}`); // is padded with "0" at the start of the string till there are three characters the reason for this is the minimum amount of characters needed to represent pounds and // pence can be represented by is 3. -//// 9-12. The next variable pounds takes the previous variable paddedPenceNumberString and uses the substring function to create a new string without the last +// 9-12. The next variable pounds takes the previous variable paddedPenceNumberString and uses the substring function to create a new string without the last // two characters. It uses .length - 2 to stop before the final two characters because those characters represent the pence leaving only the characters // that represent the pounds. From b83c9fc4542c6f227b4f374c49caa0dbf30be0f3 Mon Sep 17 00:00:00 2001 From: burhan-mustafa Date: Thu, 2 Jul 2026 15:23:09 +0100 Subject: [PATCH 11/11] removed prep folder and all files in it --- prep/error.js | 2 -- prep/error2.js | 2 -- prep/example.js | 1 - prep/exercise1.js | 11 ----------- prep/exercise2.js | 11 ----------- prep/function.js | 7 ------- prep/pence.js | 4 ---- prep/perimeter.js | 7 ------- prep/prep_script.js | 8 -------- prep/variable.js | 0 10 files changed, 53 deletions(-) delete mode 100644 prep/error.js delete mode 100644 prep/error2.js delete mode 100644 prep/example.js delete mode 100644 prep/exercise1.js delete mode 100644 prep/exercise2.js delete mode 100644 prep/function.js delete mode 100644 prep/pence.js delete mode 100644 prep/perimeter.js delete mode 100644 prep/prep_script.js delete mode 100644 prep/variable.js diff --git a/prep/error.js b/prep/error.js deleted file mode 100644 index 05845aad60..0000000000 --- a/prep/error.js +++ /dev/null @@ -1,2 +0,0 @@ -const volunteer = "Shadi"; -const volunteer = "Abdi"; diff --git a/prep/error2.js b/prep/error2.js deleted file mode 100644 index 56a57057ce..0000000000 --- a/prep/error2.js +++ /dev/null @@ -1,2 +0,0 @@ -const volunteer = "Shadi"; -volunteer = "Hinde"; diff --git a/prep/example.js b/prep/example.js deleted file mode 100644 index 3f13872550..0000000000 --- a/prep/example.js +++ /dev/null @@ -1 +0,0 @@ -console.log("Hello there!"); diff --git a/prep/exercise1.js b/prep/exercise1.js deleted file mode 100644 index 41846fd453..0000000000 --- a/prep/exercise1.js +++ /dev/null @@ -1,11 +0,0 @@ -// Write a function that will calculate the area of a rectangle -// given it's width and height - -let width = 3; -let height = 4; - -function calculateArea() { - return (area = width * height); -} - -console.log(calculateArea()); diff --git a/prep/exercise2.js b/prep/exercise2.js deleted file mode 100644 index b95db75fc8..0000000000 --- a/prep/exercise2.js +++ /dev/null @@ -1,11 +0,0 @@ -function capitaliseFirstLetter(name) { - return name[0].toUpperCase() + name.substring(1); -} - -function createGreeting(name) { - const result = capitaliseFirstLetter(name); - return `Welcome ${result}`; -} - -const greeting = createGreeting("barath"); -console.log(greeting); diff --git a/prep/function.js b/prep/function.js deleted file mode 100644 index d7ab875ed2..0000000000 --- a/prep/function.js +++ /dev/null @@ -1,7 +0,0 @@ -const decimalToPercentage = 0.5; - -function convertToPercentage() { - const percentage = decimalToPercentage * 100; - console.log(`The percentage is ${percentage}%.`); -} -convertToPercentage(); diff --git a/prep/pence.js b/prep/pence.js deleted file mode 100644 index d17161716d..0000000000 --- a/prep/pence.js +++ /dev/null @@ -1,4 +0,0 @@ -const price = 10; // Just an example value. Try changing this value to 0, 10, or 1521, and make sure you still get the right answer from your code. -const pound = price / 100; - -console.log(`The price in pounds is £${pound}.`); diff --git a/prep/perimeter.js b/prep/perimeter.js deleted file mode 100644 index a6c51048ab..0000000000 --- a/prep/perimeter.js +++ /dev/null @@ -1,7 +0,0 @@ -const height = 10; // 10 is just an example of a value here - your code should still work if you change this to another value. -const width = 30; // Also just an example - your code should still work if this changes. -const area = height * width; -const perimeter = 2 * (height + width); - -console.log(`The area of the rectangle is ${area}.`); -console.log(`The perimeter of the rectangle is ${perimeter}.`); diff --git a/prep/prep_script.js b/prep/prep_script.js deleted file mode 100644 index de219d355b..0000000000 --- a/prep/prep_script.js +++ /dev/null @@ -1,8 +0,0 @@ -const yearOfBirth = 1990; // declaration -let currentYear = 2023; // declaration - -currentYear++; // statement -`I am ${currentYear - yearOfBirth} years old`; // statement - -console.log(`I was born in ${yearOfBirth}`); // statement -console.log(`The current year is ${currentYear}`); // statement diff --git a/prep/variable.js b/prep/variable.js deleted file mode 100644 index e69de29bb2..0000000000