Skip to content

London | 26 ITP SEP | Russom Gebremeskel | Sprint 3 | Coursework - #1520

Open
russom-g wants to merge 29 commits into
CodeYourFuture:mainfrom
russom-g:coursework/sprint-3
Open

russom-g wants to merge 29 commits into
CodeYourFuture:mainfrom
russom-g:coursework/sprint-3

Conversation

@russom-g

@russom-g russom-g commented Sep 13, 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-1053

Changelist

Code error fixed, debugged, and refactored as reqiured.

@netlify

netlify Bot commented Sep 13, 2026

Copy link
Copy Markdown

Deploy Preview for cyf-onboarding-module ready!

Name Link
🔨 Latest commit f39cb79
🔍 Latest deploy log https://app.netlify.com/projects/cyf-onboarding-module/deploys/6ab0530925c49c000894688f
😎 Deploy Preview https://deploy-preview-1520--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.

@github-actions

This comment has been minimized.

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

This comment has been minimized.

@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 17, 2026
@russom-g russom-g added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 17, 2026
@github-actions

This comment has been minimized.

@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 17, 2026
@github-actions

This comment has been minimized.

@russom-g russom-g added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 19, 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.

This is in good shape. The debug section is the strongest part: all three files run and give the right output, and your explanation in 2.js about the function ignoring its argument is exactly right. Good to see you attempt the stretch too.

Four things to look at:

  1. 1-key-errors/1.js line 29, see my comment.

  2. 1-key-errors/2.js line 34, see my comment.

  3. 3-mandatory-implement/3-to-pounds.js, see my comment.

  4. 4-mandatory-interpret/time-format.js answers d) and e), see my comment.

  5. Could you run Prettier on the files you have changed? Most of them are not formatted at the moment.

Add the Needs Review label again when you have pushed.

Comment thread Sprint-3/1-key-errors/1.js Outdated
// =============> write your new code here

function convertToPercentage(decimalNumber) {
return percentage = `${decimalNumber * 100}%`;

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 original had two lines here, const percentage = ... and then return percentage. You have combined them into one, but the const has gone, so percentage is no longer being declared. Does this function need that variable at all, or could you return the template literal straight away?

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.

The function works when I test it. However, I should have kept the const percentage declaration as it is. Or return the template literal straight away.

Comment thread Sprint-3/1-key-errors/2.js Outdated
return num * num;
}

console(square(3));

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.

Run this line on its own. console is an object, not a function, so this throws. What did you mean to call?

Separately, your prediction on line 9 says ReferenceError, and your answer on line 19 correctly says SyntaxError. Worth thinking about why a ReferenceError could never happen in this particular file: what has to succeed before any line of a file can run at all?

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 was testing the function and forgot to delete the whole console(square(3)) line.

Yes my prediction was wrong. ReferenceError happens when a variable is not declared properly. Or a local variable is used in a global scope.


// You should call this function a number of times to check it works for different inputs

function toPound(priceInPence) {

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.

Two things here. The task asks for a function called toPounds and this one is toPound. And it says to call it a number of times to check it works for different inputs, where there is only the one call with "399p". What else would you try it with?

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 tested it with: 0, 00, 000, 01, 9, 58749 ...

// d) What is the value assigned to num when pad is called for the last time in this program? Explain your answer
// =============> write your answer here

// The value assigned to num is 1. This is because 1 is the last character in the string 61

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 value 1 is right, but have another look at why. remainingSeconds comes from seconds % 60 on line 12, not from taking the last character out of the string "61". What is 61 % 60, and is the result a string or a number? Answer e) has the same reasoning in it.

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.

61 % 60 is 61 divided by 60 which is 1(totalMinutes) and the leftover 1 assigned to remainingSeconds

@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 20, 2026
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