Skip to content

Manchester | 26-ITP-Sep | Mathew Shaibu | Sprint 3 | Coursework-Sprint 3 - #1586

Closed
MattCarolus10 wants to merge 75 commits into
CodeYourFuture:mainfrom
MattCarolus10:coursework/sprint-3
Closed

MattCarolus10 wants to merge 75 commits into
CodeYourFuture:mainfrom
MattCarolus10:coursework/sprint-3

Conversation

@MattCarolus10

@MattCarolus10 MattCarolus10 commented Sep 24, 2026 •

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-1053

Changelist

Completed prediction and documented syntax error
Fixed multiple calls to match log statements
Variable declaration
Used upperCase and replaceAll function
This project focused on understanding javaScript fundamentals, catching syntax errors, debugging, scope, and using function to create reusable codes

@github-actions

Copy link
Copy Markdown

Your PR description is incomplete.

You filled out a template (that starts "Learners, PR Template") when you created this PR - you can see it at the top of this page.

Make sure to fill in all fields in the template.

Please ensure:

  • All self checklist items are ticked (with a [x])
  • The "Changelist" section is filled with details of what your PR does.
  • The "Questions" section is either filled in (if you have questions) or is removed (if you don't).

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

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 24, 2026
@MattCarolus10 MattCarolus10 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 24, 2026
@github-actions

Copy link
Copy Markdown

Your PR description is incomplete.

You filled out a template (that starts "Learners, PR Template") when you created this PR - you can see it at the top of this page.

Make sure to fill in all fields in the template.

Please ensure:

  • All self checklist items are ticked (with a [x])
  • The "Changelist" section is filled with details of what your PR does.
  • The "Questions" section is either filled in (if you have questions) or is removed (if you don't).

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

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 24, 2026
@MattCarolus10 MattCarolus10 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 24, 2026
@github-actions

Copy link
Copy Markdown

Your PR description is incomplete.

You filled out a template (that starts "Learners, PR Template") when you created this PR - you can see it at the top of this page.

Make sure to fill in all fields in the template.

Please ensure:

  • All self checklist items are ticked (with a [x])
  • The "Changelist" section is filled with details of what your PR does.
  • The "Questions" section is either filled in (if you have questions) or is removed (if you don't).

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

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

1 similar comment
@github-actions

Copy link
Copy Markdown

Your PR description is incomplete.

You filled out a template (that starts "Learners, PR Template") when you created this PR - you can see it at the top of this page.

Make sure to fill in all fields in the template.

Please ensure:

  • All self checklist items are ticked (with a [x])
  • The "Changelist" section is filled with details of what your PR does.
  • The "Questions" section is either filled in (if you have questions) or is removed (if you don't).

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

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 24, 2026
@MattCarolus10 MattCarolus10 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 24, 2026
@github-actions

Copy link
Copy Markdown

The files changed in this PR don't match what is expected for this task.

Please check that you committed the right files for the task, and that there are no accidentally committed files from other sprints.

Please review the 'files changed' tab at the top of the page.

Here is an example of a file that has been changed on this branch but shouldn't be: Sprint-2/1-key-exercises/1-count.js

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

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 24, 2026
@github-actions

Copy link
Copy Markdown

The files changed in this PR don't match what is expected for this task.

Please check that you committed the right files for the task, and that there are no accidentally committed files from other sprints.

Please review the 'files changed' tab at the top of the page.

Here is an example of a file that has been changed on this branch but shouldn't be: Sprint-2/1-key-exercises/1-count.js

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

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

@MattCarolus10 MattCarolus10 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 24, 2026
@github-actions

Copy link
Copy Markdown

The files changed in this PR don't match what is expected for this task.

Please check that you committed the right files for the task, and that there are no accidentally committed files from other sprints.

Please review the 'files changed' tab at the top of the page.

Here is an example of a file that has been changed on this branch but shouldn't be: Sprint-2/1-key-exercises/1-count.js

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

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 24, 2026
@github-actions

Copy link
Copy Markdown

The files changed in this PR don't match what is expected for this task.

Please check that you committed the right files for the task, and that there are no accidentally committed files from other sprints.

Please review the 'files changed' tab at the top of the page.

Here is an example of a file that has been changed on this branch but shouldn't be: Sprint-2/1-key-exercises/1-count.js

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

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

@MattCarolus10 MattCarolus10 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 24, 2026
@github-actions

Copy link
Copy Markdown

The files changed in this PR don't match what is expected for this task.

Please check that you committed the right files for the task, and that there are no accidentally committed files from other sprints.

Please review the 'files changed' tab at the top of the page.

Here is an example of a file that has been changed on this branch but shouldn't be: Sprint-2/1-key-exercises/1-count.js

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

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 24, 2026
@MattCarolus10 MattCarolus10 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 24, 2026
@github-actions

Copy link
Copy Markdown

The files changed in this PR don't match what is expected for this task.

Please check that you committed the right files for the task, and that there are no accidentally committed files from other sprints.

Please review the 'files changed' tab at the top of the page.

Here is an example of a file that has been changed on this branch but shouldn't be: Sprint-2/1-key-exercises/1-count.js

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

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 24, 2026

@iscmiguelsamaniego iscmiguelsamaniego left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fantastic work on this exercise! You've solved the core problem cleanly. Take a look at the question above when you have a moment to think about it. Great job overall!

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hello! Fantastic job analyzing the error message. You correctly spotted that using let str = ... was trying to re-declare the parameter, causing that SyntaxError. Great problem-solving!

Your solution using str2 works and successfully capitalizes the word. I just have a couple of questions to help us think about code cleanliness:

Look closely at your function body. Since you are already creating the transformed string inside the template literal, could you put the return keyword right in front of it?

If you do that, do you actually need to declare str2 at all?

You are doing amazing. Let me know what you think! 😊

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hello! Great job working through this exercise. I have a couple of questions to help you think a bit deeper about your code:

What do you expect to see in the console when you execute console.log(convertToPercentage(10.5));?

Thinking about what a decimal number represents mathematically (for example, the 0.5 that originally represented 50%), can you imagine what would happen if we tested 0.5 or 0.75 instead of 10.5? How would the function interpret that value?

You're doing fantastic! Let me know what you think when you have a moment. 😊

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hello! Great job on this exercise! You accurately predicted the error and gave a brilliant explanation of why a function parameter needs to be a placeholder name like num instead of a fixed value like 3. Your corrected code looks spot on.

Keep up the fantastic work! Let me know if you have any questions about how parameters work under the hood.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hello! Great job fixing the function by using return instead of console.log.

Quick question to think about: when combining functions with template strings like this, why is returning the value rather than printing it directly so important?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hello! Great job spotting that the code needed the expression to be right next to the return statement. Your corrected code is clean and works perfectly.

Quick question to think about: why does JavaScript automatically insert a semicolon and stop executing right after the return keyword if nothing is on that line?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hello! Great job walking through this time-formatting exercise and carefully tracing how pad is called multiple times. Your answers show a strong understanding of how functions interact with each other.

Quick question to think about: when pad runs while (numString.length < 2), what happens if a number already has 2 digits (like 15), and how does the while loop decide whether or not to add a "0" in front of it?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hello! Great job writing the calculateBMI function! Using .toFixed(1) is a neat and effective way to format the result to one decimal place.

Quick question to think about: what type of data does the .toFixed() method return in JavaScript (is it a string or a number), and why might that matter if another part of your program expects to perform mathematical operations on the BMI result?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hello! Great job implementing the UPPER_SNAKE_CASE function using .toUpperCase() and .replaceAll(). Your test string is very creative!

Quick question to think about: just like we looked at in a previous exercise, do we need to store the transformed string in a new variable before returning it, or could we return the expression directly?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hello! Great job wrapping the original snippet into a reusable function and getting it to format the price correctly.

Quick question to think about: look closely at the parameter name you chose (inPounds) and the value you pass into it ("599p"). Does the input represent pounds or pence, and how could choosing a different parameter name make the function's purpose even clearer?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hello! Great job tackling this tricky clock-formatting exercise and successfully fixing the bugs for midnight, noon, and minutes.

Quick question to think about: looking at your test for 19:30, your function returns "7:30 pm". Comparing this with how morning hours or earlier tests are formatted (like "02:00 pm"), would it be helpful to include a leading zero for single-digit afternoon hours, and how might you do that?

@MattCarolus10 MattCarolus10 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 24, 2026
@github-actions

Copy link
Copy Markdown

The files changed in this PR don't match what is expected for this task.

Please check that you committed the right files for the task, and that there are no accidentally committed files from other sprints.

Please review the 'files changed' tab at the top of the page.

Here is an example of a file that has been changed on this branch but shouldn't be: Sprint-2/1-key-exercises/1-count.js

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

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants