Skip to content

Manchester | 26-ITP-Sep | Monsur Abdulrahman | Sprint 2 | Coursework/sprint 2 - #1600

Open
Monsur0001 wants to merge 19 commits into
CodeYourFuture:mainfrom
Monsur0001:coursework/sprint-2
Open

Monsur0001 wants to merge 19 commits into
CodeYourFuture:mainfrom
Monsur0001:coursework/sprint-2

Conversation

@Monsur0001

Copy link
Copy Markdown

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

Task code

CYF-1039

Changelist

I made corrections to some errors in the code provided and also made some explanations on the code provided.

@netlify

netlify Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for cyf-onboarding-module ready!

Name Link
🔨 Latest commit b381b0d
🔍 Latest deploy log https://app.netlify.com/projects/cyf-onboarding-module/deploys/6ab7e4c42cfb2c000816f95b
😎 Deploy Preview https://deploy-preview-1600--cyf-onboarding-module.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
2 paths audited
Performance: 100 (no change from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 86 (no change from production)
PWA: -
View the detailed breakdown and full score reports
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@Monsur0001 Monsur0001 added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 📅 Sprint 2 Assigned during Sprint 2 of this module labels Sep 26, 2026
@cjyuan cjyuan added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Sep 26, 2026
Comment thread Sprint-2/1-key-exercises/4-random.js Outdated
Comment on lines +16 to +17
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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 in $[1, 10)$ means:

$x$ is a number between 1 and 10, including 1 but excluding 10.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your feedback, I have corrected the explanation to reflect the inclusion and exclusion terms

Comment on lines -1 to 2
const cardNumber = 4533787178994213;
const cardNumber = "4533787178994213";
const last4Digits = cardNumber.slice(-4);

Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown
Author

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

Comment thread Sprint-2/2-mandatory-errors/4.js Outdated
Comment on lines +1 to +2
const TwelveHourClockTime = "8:53pm";
const TwentyFourHourClockTime = "20:53"; No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for pointing that out. I never knew I made such mistake 😀. I have made the correction to reflect the camelCasing convention.

Comment on lines +24 to +25
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(",", "")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: formattedTime could more clearly indicate the variable stores a formatted string.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for letting me Know this

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Sep 26, 2026
@Monsur0001 Monsur0001 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 26, 2026
@cjyuan

cjyuan commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

Changes so far look good.

Could you also address this comment? #1600 (comment)

@cjyuan cjyuan removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 26, 2026
@cjyuan cjyuan added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Sep 27, 2026
@cjyuan

cjyuan commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

All good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed. 📅 Sprint 2 Assigned during Sprint 2 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants