Skip to content

London | 26 ITP MAY | Russom Gebremeskel | Sprint 2 | Coursework - #1502

Open
russom-g wants to merge 46 commits into
CodeYourFuture:mainfrom
russom-g:coursework/sprint-2
Open

russom-g wants to merge 46 commits into
CodeYourFuture:mainfrom
russom-g:coursework/sprint-2

Conversation

@russom-g

@russom-g russom-g commented Sep 11, 2026 •

Copy link
Copy Markdown

Learners, PR Template

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

Using documentations errors explained fixed. Program explained step by step.

@russom-g russom-g added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Sep 23, 2026

@abdishakoor-dev abdishakoor-dev left a comment

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.

Your answers are clear and well explained. Your breakdown of line 4 in 2-time-format.js is very good, with real numbers at each step. 3-to-pounds.js step 3 also has good examples, with 11 and 1.

I have left a hint on each line. Please fix these things before I can mark this Complete:

  1. 1-percentage-change.js a) and 2-time-format.js b): both say there are no function calls. But both files have some. A function call is a function name followed by brackets, like name(...). For example, console.log(...) and Number(...) are function calls. Look for this pattern in each file, and count them again.

  2. 3-paths.js line 21: ext only works when the extension has 3 letters. The code on lines 13 and 14 shows you a better way. See my reply on line 21.

  3. 4-random.js: say what num is at the end.

  4. 2-mandatory-errors: 1.js has no explanation. 2.js and 4.js need the error type (SyntaxError, TypeError or ReferenceError). In 3.js, change line 2, not line 1.

  5. 2-time-format.js: answers c) and f).

  6. "My changes follow the style guide" is on your checklist, and consistent formatting is part of it. The tool that does it is called Prettier. It sets spacing and indentation to one agreed style. Then a reviewer only sees the changes you meant to make. Right now all the files you changed fail that check.

    Prettier comes with the CYF extension pack from onboarding. If you are not sure you have it, open VS Code, go to Extensions, and search for CodeYourFuture Extension Pack: https://marketplace.visualstudio.com/items?itemName=CodeYourFuture.cyf-extension-pack

    Then open each file you changed, right click in the editor, and choose Format Document. Pick Prettier if VS Code asks. Save, commit and push. To format every time you save, follow the format on save steps here: https://github.com/CodeYourFuture/Module-JavaScript-Fundamentals/blob/main/practical_guide.md

Add the Needs Review label again once you have pushed.


const age = 33;
let age = 33;
age = age + 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.

The fix works. But the exercise also asks you to explain the error. Please add a comment with the error type and the reason.

The prep shows three error types:

  • SyntaxError: the code breaks a rule of JavaScript, so no line runs.
  • TypeError: the code tries to do something that value cannot do.
  • ReferenceError: the code uses a variable it cannot reach.

When you ran the original file, node's error message started with one of these. Which one was it? And why does let fix it?

Comment thread Sprint-2/2-mandatory-errors/2.js Outdated
const cityOfBirth = "Bolton";
console.log(`I was born in ${cityOfBirth}`);

// Java script cannot access the variable cityOfBirth before initialization. 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.

Your reason is right, and the fix works. Please also write the error type.

The prep shows three error types:

  • SyntaxError: the code breaks a rule of JavaScript, so no line runs.
  • TypeError: the code tries to do something that value cannot do.
  • ReferenceError: the code uses a variable it cannot reach.

When you ran the original file, node's error message started with one of these. Which one was it?

Comment thread Sprint-2/2-mandatory-errors/4.js Outdated
const twelveHourClockTime = "8:53pm";
const twentyFourHourClockTime = "20:53";

// Variable names cannot start with a number in Java Script. 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.

Your reason is right, and the new names work. Please also write the error type.

The prep shows three error types:

  • SyntaxError: the code breaks a rule of JavaScript, so no line runs.
  • TypeError: the code tries to do something that value cannot do.
  • ReferenceError: the code uses a variable it cannot reach.

When you ran the original file, node's error message started with one of these. Which one was it?


// b) There are no function calls.

// c) The reminder (%) operator returns the reminder left over when one operand is divided by a second operand.

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.

This is what % does in general. In this program, movieLength % 60 gives 24. Are those 24 seconds, minutes or hours? Write what the 24 means here.


// e) result represents the length of the movie in hours, minutes, and seconds format. It can be renamed movieDuration.

// f) When displaying single digit hour, minute, or seconds it doesn't include 0 in front of the digit. 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.

Good, that is one problem. Now try -90 and 90.5 as movieLength. What does the program print each time? Add what you see to f).

@abdishakoor-dev abdishakoor-dev 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 Sep 23, 2026
@russom-g russom-g added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Sep 26, 2026

@abdishakoor-dev abdishakoor-dev left a comment

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.

3-paths.js and 4-random.js are fixed now. Thanks.

Some changes you mention in the threads are not in the PR. For example, 2-time-format.js b) still says "There are no function calls". And 3.js has not changed since 16 September. Maybe the files were not saved, or not pushed. In VS Code, a dot on a file tab means the file is not saved.

Still to do:

  1. 1-percentage-change.js a): your lines are right. The question also asks how many calls. Line 4 has two. Write the total.
  2. 2-time-format.js b): line 10 has console.log(result). That is a function call. So the answer is 1.
  3. 2-mandatory-errors/3.js: go back to your first version on line 2, as in my thread reply. Line 1 stays a number.
  4. 2-mandatory-errors/1.js, 2.js and 4.js: add the error type to each. See my comments on those files.
  5. 2-time-format.js c) and f): see my comments on lines 33 and 39.
  6. Prettier: most of the files you changed still fail the check. Format each one, then push. Format on save stops this coming back: https://github.com/CodeYourFuture/Module-JavaScript-Fundamentals/blob/main/practical_guide.md

Add the Needs Review label again once you have pushed.

@abdishakoor-dev abdishakoor-dev 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 Sep 26, 2026
@russom-g

Copy link
Copy Markdown
Author

@abdishakoor-dev Everything is updated now.

@russom-g russom-g added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Sep 26, 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-3/4-mandatory-interpret/.gitignore

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 26, 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-3/4-mandatory-interpret/.gitignore

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.

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.

3 participants