Skip to content

Commit 9f92cf3

Browse files
committed
Deleted sprint 2 old branches, re-added files in subfolders and committed changes to all files with my answers
1 parent 2ad51f8 commit 9f92cf3

12 files changed

Lines changed: 18 additions & 5 deletions

File tree

‎Sprint-2/1-key-exercises/2-initials.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ const initials = firstName[0] + middleName[0] + lastName[0];
1212
console.log(initials);
1313

1414
// https://www.google.com/search?q=get+first+character+of+string+mdn
15+
16+
// CN - added comment to have a clean commit

‎Sprint-2/1-key-exercises/3-paths.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ const ext = base.slice(base.lastIndexOf("."));
2525
console.log(`The dir part of ${filePath} is ${dir}`);
2626
console.log(`The ext part of ${base} is ${ext}`);
2727

28-
// https://www.google.com/search?q=slice+mdn
28+
// https://www.google.com/search?q=slice+mdn
29+
// CN - added comment to have a clean commit

‎Sprint-2/1-key-exercises/4-random.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ console.log(num)
1313
// Answer: For calculations i utilised BODMAS formula solving numbers in brackets first, multiplication, subtraction and addition
1414
// I used 0.68 for math.floor(random number) + 1
1515
// Sum = 69
16+
// CN - added comment to have a clean commit

‎Sprint-2/2-mandatory-errors/0.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
//This is just an instruction for the first activity - but it is just for human consumption
22
// We don't want the computer to run these 2 lines - how can we solve this problem?
33

4-
// I have commented out the lines. The computer removes commented lines from code compilation
4+
// I have commented out the lines. The computer removes commented lines from code compilation
5+
// CN - added comment to have a clean commit

‎Sprint-2/2-mandatory-errors/1.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ age = age + 1;
66
console.log(age)
77

88
// The TypeError: Assignment to constant variable implies we are trying to reassign the variable twice.
9-
// This case, I have used let instead in order to allow the variable to be reused.
9+
// This case, I have used let instead in order to allow the variable to be reused.
10+
// CN - added comment to have a clean commit

‎Sprint-2/2-mandatory-errors/3.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ console.log(last4Digits)
1414
// Error returned: TypeError: cardNumber.slice is not a function
1515
// Lesson learnt here; slice method is only available for strings or arrays not numbers
1616
// So converted the cardNumber into a string first
17+
// CN - added comment to have a clean commit

‎Sprint-2/3-mandatory-interpret/1-percentage-change.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,5 @@ console.log(`The percentage change is ${percentageChange}`);
2727
//const priceDifference = carPrice - priceAfterOneYear;
2828
//const percentageChange = (priceDifference / carPrice) * 100;
2929
// e) Describe what the expression Number(carPrice.replaceAll(",","")) is doing - what is the purpose of this expression?
30-
// e) cleans the amount format by removing characters such as , and leaving only number
30+
// e) cleans the amount format by removing characters such as , and leaving only number
31+
// CN - added comment to have a clean commit

‎Sprint-2/3-mandatory-interpret/2-time-format.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,4 @@ console.log(result);
2929
// f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer
3030
//any number greater than zero returns a valid positive hour, minute or seconds result. Changing the length to 0 returns 0:0:0. Any negative length returns negative values
3131

32+
// CN - added comment to have a clean commit

‎Sprint-2/3-mandatory-interpret/3-to-pounds.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ console.log(`£${pounds}.${pence}`);
2323
// 3. const paddedPenceNumberString - ensures the figure is 3 characters to taking us back to 399
2424
// 4 const pounds - removes 2 characters from the amount = 3
2525
// 5. const pence - adds the amount by 2 characters taking us back to either 39 or 99
26-
// 6. console displays the figures in pounds and pence = 3.99
26+
// 6. console displays the figures in pounds and pence = 3.99
27+
// CN - added comment to have a clean commit

‎Sprint-2/4-stretch-explore/chrome.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ Now try invoking the function `prompt` with a string input of `"What is your nam
1313

1414
What effect does calling the `prompt` function have?
1515
What is the return value of `prompt`?
16+
// CN - added comment to have a clean commit

0 commit comments

Comments
 (0)