-
-
Notifications
You must be signed in to change notification settings - Fork 547
Manchester | 26-ITP-Sep | Precious Moses | Sprint 2 | Course-work-2 #1537
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
moses77-boop
wants to merge
84
commits into
CodeYourFuture:main
Choose a base branch
from
moses77-boop:coursework/sprint-2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
84 commits
Select commit
Hold shift + click to select a range
1d8957c
Add hello_world.js file
moses77-boop cb5fd1c
Add hello_world.js file with initial console log
moses77-boop 3dcb7b7
Add fact.js file
moses77-boop 14998ae
Add fun fact about sprints to fact.js
moses77-boop 4b9c01a
Rename file fact.js to facts.js
moses77-boop 386a826
Add greeting.js file
moses77-boop ed354a3
Add greeting message to greeting.js
moses77-boop 02c297f
Add console log for greeting message in greeting.js
moses77-boop d3c778f
Update greeting message to include name in greeting.js
moses77-boop 0411379
Change greeting variable from const to let and update its value to "G…
moses77-boop c6ad8eb
Add boolean.js file
moses77-boop d2880fb
Add boolean.js with initial console log comparisons
moses77-boop 2bddb02
Add additional comparison console logs in boolean.js
moses77-boop 3f06814
Add passwordChecker.js file
moses77-boop 1b3d99b
Add password validation logic in passwordChecker.js
moses77-boop 56326fb
Add else statement to password validation logic
moses77-boop cae8927
Update userInput for password validation test
moses77-boop ad792cd
Add adminPassword variable in passwordChecker.js
moses77-boop 31d8426
Add else if condition to password validation logic in passwordChecker.js
moses77-boop 0f097a3
Add exercise.js file
moses77-boop 1d56388
Remove unused exercise.js file
moses77-boop 220a714
Add response variable declaration in passwordChecker.js
moses77-boop 762e97f
Update else condition to assign response message for incorrect passwo…
moses77-boop 39b87c3
Log response message for incorrect password in passwordChecker.js
moses77-boop 3a1178c
Change response declaration from const to let in passwordChecker.js
moses77-boop c984e1a
Add console log for count variable in 1-count.js
moses77-boop ac61856
Add detailed comments explaining count variable increment in 1-count.js
moses77-boop d233466
Implement initials extraction from first, middle, and last names in 2…
moses77-boop ccf1a79
Add console log to display initials in 2-initials.js
moses77-boop 6dbe2c4
Fix comment formatting for clarity in 1-count.js
moses77-boop 15f4a87
Add solution comment for clarity in 2-initials.js
moses77-boop 4eede60
Implement dir extraction from filePath and log the result in 3-paths.js
moses77-boop 70f8230
Add variable assignment and Implement ext extraction logic in 3-paths.js
moses77-boop df08e0a
Add console log to display file extension in 3-paths.js
moses77-boop 298f6d8
Add solution comment for clarity in 4-random.js
moses77-boop f291495
Add clarification comment for "num" in 4-random.js
moses77-boop e1edb49
Add breakdown comment in 4-random.js
moses77-boop cf88162
Add detailed breakdown comment for Math.random in 4-random.js
moses77-boop de4738f
Add additional breakdown comments in 4-random.js
moses77-boop d93a91d
Add additional breakdown comments in 4-random.js
moses77-boop 20ea364
Add breakdown comments for Math.floor in 4-random.js
moses77-boop e10fbf9
Add explanation for shifting range in random number generation
moses77-boop 57981df
Add console log for generated random number in 4-random.js
moses77-boop 6ac46a6
Refactor comments in 4-random.js for readability
moses77-boop 0175ffc
Wrap instructional lines in multi-line comment and add solution expla…
moses77-boop 05aa2b7
Change age variable from const to let for reassignment
moses77-boop 15a4e9a
Add console log for updated age variable
moses77-boop 557caf0
Add reference error comment for cityOfBirth initialization issue
moses77-boop 08f2261
Add explanation comment for cityOfBirth reference error
moses77-boop 1d0d876
Fix ReferenceError by declaring cityOfBirth before initializing conso…
moses77-boop c4049e2
Add prediction and explanation comments for cardNumber slicing issue
moses77-boop 466f652
Add console log for last4Digits
moses77-boop 4c83857
Add error message and explanation for cardNumber slicing issue
moses77-boop 3fe8bc3
Fix last4Digits assignment by converting cardNumber to string for sli…
moses77-boop d65f2eb
Add console log for 12-hour and 24-hour clock times
moses77-boop 0c7b749
Add comments explaining SyntaxError due to invalid identifier names
moses77-boop 5486566
Fix variable names by renaming identifiers starting with digits
moses77-boop b23cf15
Add solution comments detailing function calls in 1-percentage-change.js
moses77-boop 84c9f96
Add error explanation in 1-percentage-change.js
moses77-boop f4a107a
Add error resolution comment for SyntaxError in 1-percentage-change.js
moses77-boop 37cab85
Fix syntax error by adding missing comma in replaceAll function call …
moses77-boop 9e31beb
Add comments for variable reassignment statements in 1-percentage-cha…
moses77-boop 0a35180
Add comments for variable declarations in 1-percentage-change.js
moses77-boop 722ed1c
Add detailed explanation for Number conversion in 1-percentage-change.js
moses77-boop 41ef602
Add solution comments for variable declarations in 2-time-format.js
moses77-boop b9beadc
Add explanation for function call in 2-time-format.js
moses77-boop b96468b
Add detailed explanation for remainder operator in 2-time-format.js
moses77-boop d6a7f93
Add explanation for totalMinutes calculation in 2-time-format.js
moses77-boop 179fcb4
Add explanation for totalMinutes calculation, result meaning and sugg…
moses77-boop 2926cd8
Refactor convert function to encapsulate logic and test with various …
moses77-boop 01db8a2
Refactor convert function to return formatted time instead of logging it
moses77-boop 6f6bcad
Add notes on limitations of movieLength handling in convert function
moses77-boop ea7dbc1
Add detailed explanation for penceStringWithoutTrailingP processing i…
moses77-boop 893336e
Add detailed explanation for paddedPenceNumberString processing in 3-…
moses77-boop 6468f29
Add detailed explanation for pounds extraction in 3-to-pounds.js
moses77-boop 2baa16a
Add detailed explanation for pence calculation in 3-to-pounds.js
moses77-boop fdcbeb0
Clarify explanation for paddedPenceNumberString processing in 3-to-po…
moses77-boop 105bbf8
Add explanation for pence calculation in 3-to-pounds.js
moses77-boop c524311
Add explanation for final output in 3-to-pounds.js
moses77-boop 361a9e7
Clarify explanation for substring method in pounds extraction in 3-to…
moses77-boop 4253d8f
Delete prep directory
moses77-boop a6e4115
Fix formatting of initials string in 2-initials.js
moses77-boop 0a199cd
Remove trailing space from initials string in 2-initials.js
moses77-boop 01284c0
Fix line number reference for console.log in comments in 1-percentage…
moses77-boop File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,5 @@ | ||
| 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?*/ | ||
|
|
||
| //Solution | ||
| //This problem was solved by wrapping the statement in a multi-line comment tag. This way the lines are stopped from executing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,6 @@ | ||
| // 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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,9 @@ | ||
| // 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}`); | ||
| const cityOfBirth = "Bolton"; | ||
| console.log(`I was born in ${cityOfBirth}`); | ||
|
|
||
|
|
||
| //ReferenceError: Cannot access 'cityOfBirth' before initialization. | ||
| //console.log tries to use cityOfBirth inside the template literal, but cityOfBirth has not been declared yet at that point in the code. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,21 @@ | ||
| const cardNumber = 4533787178994213; | ||
| const last4Digits = cardNumber.slice(-4); | ||
| const last4Digits = String(cardNumber).slice(-4); | ||
|
|
||
| // 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 | ||
| // 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 | ||
|
|
||
|
|
||
| //Solution | ||
| //Prediction - The code would not run because 'cardNumber' is declared as numbers instead of a string. | ||
| // The '.slice()' method belongs to strings and arrays, it could only work by treating it's subject as a sequence of characters. | ||
|
|
||
| console.log(last4Digits); | ||
|
|
||
| //Error message - TypeError: cardNumber.slice is not a function | ||
| //Reason for error | ||
| //The error thrown was considerably as predicted. | ||
| //'.slice()' is a method defined on 'String.prototype', and since 'cardNumber' was declared with a numeric literal, JavaScript treats it as the 'number' type. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,7 @@ | ||
| const 12HourClockTime = "8:53pm"; | ||
| const 24hourClockTime = "20:53"; | ||
| const ClockTime12Hour = "8:53pm"; | ||
| const ClockTime24hour = "20:53"; | ||
|
|
||
| console.log(ClockTime12Hour, ClockTime24hour); | ||
|
|
||
| //There is a SyntaxError after running the code. | ||
| //This error occurred because the identifiers '12HourClockTime' and '24hourClockTime' both start with a digit. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0 - 99 are 100 possibilities, not 99 possibilities - but I got what you mean.