Skip to content

London | 26-ITP-Sep | Anita Amirhaeri | Sprint 3 | coursework/sprint 3 - #1636

Open
anitahy73 wants to merge 27 commits into
CodeYourFuture:mainfrom
anitahy73:acoursework/sprint-3
Open

anitahy73 wants to merge 27 commits into
CodeYourFuture:mainfrom
anitahy73:acoursework/sprint-3

Conversation

@anitahy73

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

oursework/sprint 3

Questions

@netlify

netlify Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for cyf-onboarding-module ready!

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

@anitahy73 anitahy73 added 📅 Sprint 3 Assigned during Sprint 3 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Oct 1, 2026
@github-actions

This comment has been minimized.

1 similar comment
@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 Oct 1, 2026
@anitahy73 anitahy73 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 6, 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 Oct 6, 2026
Removed placeholder comments and explanations in time-format.js.
@anitahy73 anitahy73 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 6, 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 Oct 6, 2026
Added comments to explain the behavior of the pad function and its calls in formatTimeDisplay.
@anitahy73 anitahy73 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 6, 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 Oct 6, 2026
@anitahy73 anitahy73 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 6, 2026
@abdishakoor-dev

abdishakoor-dev commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Before I can review your Sprint 3 work, this PR needs to change Sprint 3 files only. At the moment it also changes 5 Sprint 2 files, which is why the bot keeps taking the Needs Review label off:

  • Sprint-2/1-key-exercises/1-count.js
  • Sprint-2/1-key-exercises/3-paths.js
  • Sprint-2/2-mandatory-errors/4.js
  • Sprint-2/3-mandatory-interpret/1-percentage-change.js
  • Sprint-2/3-mandatory-interpret/3-to-pounds.js

Your Sprint 2 work is already completed. It's in your Sprint 2 PR (#1553), which is already marked Complete. So we can simply remove the Sprint 2 files from this PR:

  1. Open the project in VS Code. In the bottom-left corner, check the branch name says acoursework/sprint-3. If it doesn't, click it and pick acoursework/sprint-3 from the list.
  2. Open a terminal: Terminal menu, then New Terminal.
  3. Copy and paste these lines one at a time, pressing Enter after each:
git pull
git fetch https://github.com/CodeYourFuture/Module-JavaScript-Fundamentals.git main
git checkout FETCH_HEAD -- Sprint-2
git commit -m "Remove Sprint-2 changes from this PR"
git push
  1. Refresh this page and click the Files changed tab at the top. You should see only Sprint-3 files (10 of them), and no Sprint-2 files.
  2. Add the Needs Review label again. This time it will stay.

If anything looks different from what I've described, or you get an error, post a screenshot here and I'll help you through it.

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

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

@anitahy73 anitahy73 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 11, 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 Oct 11, 2026
@anitahy73 anitahy73 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 11, 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.

Thanks for clearing out the Sprint 2 files. Your answers are right almost everywhere, however, there are there are still few issues to resolve before I can mark it Complete:

  1. Four files stop with an error before they reach your fix: 1-key-errors/0.js, 1.js, 2.js and 2-mandatory-debug/2.js. Put // in front of the original code in each, run node on the file, and check your new code prints what you expect.
  2. 1-key-errors/1.js line 25 has a stray ca.
  3. 2-mandatory-debug/2.js line 30 declares num a second time.
  4. time-format.js b): check which value pad gets first (line 36).
  5. 1-bmi.js: call calculateBMI with an example and print the result.
  6. Format Document on 1-key-errors/1.js and 2.js and save.

Add the Needs Review label again when you've pushed.

str = `${str[0].toUpperCase()}${str.slice(1)}`;
return str;
}
console.log(capitalise("mother"));

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 node 0.js: node stops at line 14 with the SyntaxError, so this line never runs. Put // in front of lines 13 to 16, the original code. Lines 6 to 10 and 20 to 22 do the same thing now, so you only need one of them.

// =============> write your new code here
function convertToPercentage(decimalNumber) {
const percentage = `${decimalNumber * 100}%`;
ca

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.

What is ca doing here? Once lines 10 to 17 are in comments, run the file and see what node says about it.

// =============> write your prediction of the error here
// =============> write your prediction of the error here:We will have a SyntaxError because we need a valid function parameter.

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

Your explanation is right. Now put // in front of lines 8 to 10, so that node can run your fixed square on line 20. This also lets Format Document work on the file.

// Finally, correct the code to fix the problem
// =============> write your new code here
// =============> write your new code here:
const num = 103;

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.

node stops here: SyntaxError: Identifier 'num' has already been declared, because line 6 already made num. Put the original code (lines 6 to 14) in comments. Then does your new getLastDigit need this line at all?

//totalMinutes = (61 - 1) / 60 → 1
//remainingMinutes = 1 % 60 → 1
//totalHours = (1 - 1) / 60 → 0
//num = 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.

Line 15 calls pad(totalHours) first. On line 35 you worked out totalHours is 0, and your answer to c) starts from 0 too. So what is num the first time?

function calculateBMI(weight, height) {
// return the BMI of someone based off their weight and height
const bmi = weight / (height * height);
return bmi.toFixed(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.

toFixed(1) gives the string the spec asks for. Good. Call it with the example from line 5 and print the result: do you get "23.4"? Your other two implement files already do this.

@abdishakoor-dev abdishakoor-dev removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 12, 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. 📅 Sprint 3 Assigned during Sprint 3 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants