Manchester | 26-ITP-Sep | Monsur Abdulrahman | Sprint 2 | Coursework/sprint 2 - #1600
Monsur0001 wants to merge 19 commits into
Conversation
… extraction works correctly
… comments for clarity
…larity on variable usage and limitations
✅ Deploy Preview for cyf-onboarding-module ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
| Math.random() //generates a random decimal number between 0 and 1. This means that the value of Math.random() | ||
| // can be any number between 0 and 1, but it will never be exactly 1. |
There was a problem hiding this comment.
Note: We could also use the concise and precise interval notation to describe a range of values.
[,]=> inclusion(,)=> exclusion
For example,
$x$ is a number between 1 and 10, including 1 but excluding 10.
There was a problem hiding this comment.
Thank you for your feedback, I have corrected the explanation to reflect the inclusion and exclusion terms
| const cardNumber = 4533787178994213; | ||
| const cardNumber = "4533787178994213"; | ||
| const last4Digits = cardNumber.slice(-4); |
There was a problem hiding this comment.
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.
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
| const TwelveHourClockTime = "8:53pm"; | ||
| const TwentyFourHourClockTime = "20:53"; No newline at end of file |
There was a problem hiding this comment.
In JS naming convention, variable names usually begins with a lowercase letter. Names starting with an uppercase letter are used for built-in or custom data types (e.g., Math)
There was a problem hiding this comment.
Thank you for pointing that out. I never knew I made such mistake 😀. I have made the correction to reflect the camelCasing convention.
| The error is occurring on line 5 because the "," character was ommited in the replaceAll function, to fix the problem, | ||
| we need to include the "," character in the replaceAll function like this: priceAfterOneYear.replaceAll(",", "") |
There was a problem hiding this comment.
We could more precisely describe "A comma is missing between "," and "" in the function call" as:
A comma is missing between the ___________s.
What is this programming term that refers to the values passed to a function? It begins with an 'a'.
There was a problem hiding this comment.
Thank you so much for this, I have made a correction to that effect, also I now know the difference between argument and a parameter. While they are used interchangeably, an argument is the exact value we passed to the function while parameter is the placeholder value
|
|
||
| // e) What do you think the variable result represents? Can you think of a better name for this variable? | ||
| // The variable result represents the formatted time string in the format "hours:minutes:seconds". | ||
| // A better name for this variable could be "formattedTime" or "movieDuration" |
There was a problem hiding this comment.
Note: formattedTime could more clearly indicate the variable stores a formatted string.
There was a problem hiding this comment.
Thank you for letting me Know this
…and exclusion concepts
…nts for clarity and consistency in percentage change calculations
|
Changes so far look good. Could you also address this comment? #1600 (comment) |

Self checklist
Task code
CYF-1039
Changelist
I made corrections to some errors in the code provided and also made some explanations on the code provided.