Skip to content

Conversation

@MohammedNaru
Copy link

@MohammedNaru MohammedNaru commented Oct 14, 2025

Sprint 3 Coursework/sprint 1

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

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.

@github-actions
Copy link

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).

@MohammedNaru MohammedNaru changed the title West Midlands | ITP-Sept-2025 | Muhammad Naru | Sprint-3 | Coursework/sprint 1 West Midlands | ITP-Sept-2025 | Ali Naru | Sprint-3 | Coursework/sprint 1 Oct 14, 2025
@github-actions
Copy link

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).

@MohammedNaru MohammedNaru changed the title West Midlands | ITP-Sept-2025 | Ali Naru | Sprint-3 | Coursework/sprint 1 West Midlands | ITP-Sept-2025 | Ali Naru | Sprint 3 | Coursework/sprint 1 Oct 14, 2025
@github-actions
Copy link

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
@github-actions
Copy link

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).

@github-actions
Copy link

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).

@MohammedNaru MohammedNaru changed the title West Midlands | ITP-Sept-2025 | Ali Naru | Sprint 3 | Coursework/sprint 1 West Midlands | ITP-Sept-2025 | Ali Naru | Sprint 3 | Coursework/sprint-1 Oct 14, 2025
@github-actions
Copy link

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).

@MohammedNaru MohammedNaru added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 18, 2025
Comment on lines +10 to +11
// 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.
Copy link
Contributor

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);
Copy link
Contributor

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)
Copy link
Contributor

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)"

Comment on lines +1 to +2
const Twelve_HourClockTime = "20:53";
const Twenty_Four_hourClockTime = "08:53";
Copy link
Contributor

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".
Copy link
Contributor

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?

Copy link
Contributor

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?

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Oct 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Reviewed Volunteer to add when completing a review with trainee action still to take.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants