-
-
Notifications
You must be signed in to change notification settings - Fork 546
Manchester | 26-ITP-Sep | Monsur Abdulrahman | Sprint 2 | Coursework/sprint 2 #1600
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
Monsur0001
wants to merge
19
commits into
CodeYourFuture:main
Choose a base branch
from
Monsur0001: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
19 commits
Select commit
Hold shift + click to select a range
1b5ce16
Clarify the assignment operation in count.js
Monsur0001 6f2377a
Implement initials extraction from first, middle, and last names
Monsur0001 78f922e
Extracts first characters from firstname, middlename and lastname in …
Monsur0001 1ca86a4
Implement extraction of directory and extension from file path in 3-p…
Monsur0001 6fd351c
Fix typo in explanation of assignment operation in count.js
Monsur0001 b117813
Enhance documentation in 4-random.js to clarify the random number gen…
Monsur0001 fa638a8
Add comments to clarify instructions in 0.js for better readability
Monsur0001 4c61057
Change age variable from const to let for reassignment
Monsur0001 9de5303
Fix console log placement to ensure cityOfBirth is defined before usage
Monsur0001 2c371d5
Fix cardNumber definition to use string format and ensure last4Digits…
Monsur0001 c52b17e
Fix variable naming for clock time constants to follow camelCase conv…
Monsur0001 2ebfefd
Fix typo in replaceAll function call for priceAfterOneYear and update…
Monsur0001 e16a1ca
Experiment movieLength to a negative value and enhance comments for c…
Monsur0001 c9aaa7a
Step-by-step breakdown of the price conversion process
Monsur0001 ab1e16c
Specify that Math.random() includes 0 but not 1, using the inclusion …
Monsur0001 1421faf
Fix variable naming for clock time constants to follow camelCase conv…
Monsur0001 209b644
Clarify error explanation regarding missing comma in replaceAll funct…
Monsur0001 623bd7d
Clarify explanation to reflect the word "Argument" and Refactor comme…
Monsur0001 b381b0d
Refactor variable name suggestion for clarity in time formatting
Monsur0001 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,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? |
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,4 @@ | ||
| // trying to create an age variable and then reassign the value by 1 | ||
|
|
||
| const age = 33; | ||
| let age = 33; | ||
| age = age + 1; |
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,6 @@ | ||
| // 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}`); | ||
|
|
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,22 @@ | ||
| 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 | ||
|
|
||
| The code is not working because the "slice" method is being used incorrectly. The "slice" | ||
| method should be called on the string "cardNumber" to extract the last 4 digits. However, | ||
| if there is a syntax error or if the variable "cardNumber" is not defined correctly, it could lead to an error. | ||
|
|
||
| // 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? | ||
| It gives an error because the "slice" method is being called on a string, but if the string is not defined correctly or | ||
| if there is a typo in the variable name, it will result in an error. This is what I predicted, as | ||
| I anticipated that the issue would be related to how the "slice" method is being used on the string. | ||
|
|
||
| // Then try updating the expression last4Digits is assigned to, in order to get the correct value | ||
|
|
||
| I updated the expression to correctly use the "slice" method on the "cardNumber" string. I converted the cardNumber to a | ||
| string with the ("") and then used the slice method to extract the last 4 digits. | ||
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,2 @@ | ||
| const 12HourClockTime = "8:53pm"; | ||
| const 24hourClockTime = "20:53"; | ||
| const twelveHourClockTime = "8:53pm"; | ||
| const twentyFourHourClockTime = "20:53"; |
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
Oops, something went wrong.
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.
Suppose you were not allowed to modify the statement
const cardNumber = 4533787178994213;(that is, keep the variable's value unchanged).
How would you modify the code (through type conversion) to still being able to use
.slice(-4)to extract the last 4 digits from the given number.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.
I could also do same by converting card number to string using cardNumber.toString().slice(-4).
I had used the (“”) to convert the digits to String in this code