-
-
Notifications
You must be signed in to change notification settings - Fork 239
West Midlands | ITP-Sept-2025 | Ali Naru | Sprint 3 | Coursework/sprint-1 #770
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
base: main
Are you sure you want to change the base?
West Midlands | ITP-Sept-2025 | Ali Naru | Sprint 3 | Coursework/sprint-1 #770
Conversation
|
Your PR's title isn't in the expected format. Please check the expected title format, and update yours to match. Reason: Sprint part (Sprint-3) doesn't match expected format (example: 'Sprint 2', without quotes) If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). |
|
Your PR's title isn't in the expected format. Please check the expected title format, and update yours to match. Reason: Sprint part (Sprint-3) doesn't match expected format (example: 'Sprint 2', without quotes) If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). |
|
Your PR description contained template fields which weren't filled in. Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed. If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). |
2 similar comments
|
Your PR description contained template fields which weren't filled in. Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed. If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). |
|
Your PR description contained template fields which weren't filled in. Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed. If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). |
|
Your PR description contained template fields which weren't filled in. Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed. If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). |
…onsole.log and enhance comments for clarity (2.js)
…ate comments for clarity
…mat calculation 2-time-format.js
| // Line 3 is updating the value of the count variable by adding 1 to its current value. | ||
| // The = operator is used for assignment, meaning it takes the result of the expression on the right (count + 1) and assigns that new value back to the count variable. |
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.
Operation like count = count + 1 is very common in programming, and there is a programming term describing such operation.
Can you find out what one-word programming term describes the operation on line 3?
| const dir = ; | ||
| const ext = ; | ||
| const dir = filePath.slice(0, lastSlashIndex); | ||
| const ext = filePath.slice(lastSlashIndex); |
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.
Based on your understanding, what is the "ext" part of /Users/mitch/cyf/Module-JS1/week-1/interpret/file.txt?
|
|
||
| // at the top we can see our minimum and maximum values which are fixed therefore Constants, | ||
| // we then have our variable num which is assigned a value using the Math object and its methods floor and random | ||
| // Math.random() generates a random decimal number between 0 (inclusive) and 1 (exclusive) |
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.
We can also use the concise and precise interval notation to describe a range of values.
[,]=> inclusion(,)=> exclusion
For example, we can say, "Math.random()returns a random number in the interval[0, 1)"
| const Twelve_HourClockTime = "20:53"; | ||
| const Twenty_Four_hourClockTime = "08:53"; |
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.
Names that begin with uppercase letters are conventionally used for types or classes (e.g., Math, Number, String).
For variables, the naming convention is to use camelCase.
| // 2. const penceStringWithoutTrailingP = penceString.substring(0, penceString.length - 1): removes the trailing "p" from the string by taking all characters from index 0 up to but not including the last one, leaving "399". This isolates the numeric part of the price. | ||
| // 3. const paddedPenceNumberString = penceStringWithoutTrailingP.padStart(3, "0"): ensures the numeric string has at least three digits by adding leading zeros if needed (for example, "5p" becomes "005"). This makes it easier to separate pounds and pence later. | ||
| // 4. const pounds = paddedPenceNumberString.substring(0, paddedPenceNumberString.length - 2): extracts all digits except the last two to represent the pounds. For "399" this gives "3". | ||
| // 5. const pence = paddedPenceNumberString.substring(paddedPenceNumberString.length - 2).padEnd(2, "0"): takes the last two digits of the string as pence, and if needed, pads the end with a zero to ensure two digits. For "399" this gives "99". |
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.
Could we expect this program to work as intended for any valid penceString if we deleted .padEnd(2, "0") from the code?
In other words, do we really need .padEnd(2, "0") in this script?
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.
This file is not related to Sprint-1 exercise. Can you revert the changes made to the file to keep this branch clean?
Sprint 3 Coursework/sprint 1
Self checklist
Changelist
In 1-key exercise, I completed short JavaScript programs and tasks.
2- mandatory -errors exercises are complete. I ran the code in Node.js and wrote the reason for each error
3-mandatory -interpret exercises are complete
Questions
No questions.