Skip to content

Manchester | 26-ITP-Sept | Fatima Rouchi | Sprint 3 | Coursework/sprint 3 - #1634

Open
fatimarouchi wants to merge 19 commits into
CodeYourFuture:mainfrom
fatimarouchi:coursework/sprint-3
Open

fatimarouchi wants to merge 19 commits into
CodeYourFuture:mainfrom
fatimarouchi:coursework/sprint-3

Conversation

@fatimarouchi

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

CYF-1053

@netlify

netlify Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for cyf-onboarding-module ready!

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

@fatimarouchi fatimarouchi added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 30, 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 overall across all these exercises! You've shown great progress in fixing scope issues, handling function parameters, working with string methods, and writing robust tests.
As you keep practicing, what strategies do you find most helpful for anticipating edge cases before writing your code?"

Comment thread Sprint-3/1-key-errors/0.js
Comment thread Sprint-3/1-key-errors/1.js
Comment thread Sprint-3/1-key-errors/2.js
Comment thread Sprint-3/2-mandatory-debug/0.js
Comment thread Sprint-3/2-mandatory-debug/1.js
Comment thread Sprint-3/3-mandatory-implement/1-bmi.js
Comment thread Sprint-3/3-mandatory-implement/2-cases.js

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Spot on! This is a clever way to handle string slicing and padding to format the currency correctly.

  • What happens if someone passes "599" without the trailing "p", or if they pass a number like 599 directly? How could you make the function flexible enough to handle those cases?

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.

Without the p, it removes a digit by mistake. I can convert the input to a string and remove the p only when it’s there.

Comment thread Sprint-3/4-mandatory-interpret/time-format.js
Comment thread Sprint-3/5-stretch-extend/format-time.js
@fatimarouchi fatimarouchi added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Oct 2, 2026
@mayowaolokun mayowaolokun 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 Oct 2, 2026

@mayowaolokun mayowaolokun 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.

You have clearly understood the main ideas, and your fixes and edge-case tests show good thinking.
I have left a few comments on things to look at again, mainly output formatting, adding more test examples, and how your tests report success. Please read through them, make your changes.

return percentage;
}

console.log(convertToPercentage(0.5));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Well done fixing the original error by removing the redeclared const decimalNumber, and your code runs correctly; just note that toFixed(1) changes the output from 50% to 50.0%, so either remove it to match the expected result or add a short comment explaining why you chose to include it.

// return the BMI of someone based off their weight and height
return (weight / (height * height)).toFixed(1);
}
console.log(calculateBMI(52, 1.63));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The exercise asks for the function to be implemented and checked with several inputs, ensuring the function works across multiple inputs. You can add a few more test checks to demonstrate this.

return words.toUpperCase().trim().split(/\s+/).join("_");
}

console.log(toUpperSnakeCase("hello there"));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good work, your function correctly converts the string to UPPER_SNAKE_CASE, and using trim() with split(/\s+/) is a thoughtful way to handle extra spaces; you can add a few more test examples, such as a single word like "hello", and a string with extra spaces to show it works for a range of inputs

}

return `${formattedHours}:${minutes} ${suffix}`;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice work using hours % 12 with the reset to 12, which handles both midnight and noon correctly; one thing to fix is that formattedHours is a number, so 08:00 returns 8:00 am instead of 08:00 am. You look into fixing that.

Comment on lines +29 to +51

const noonOutput = formatAs12HourClock("12:00");
const noonTarget = "12:00 pm";
console.assert(
noonOutput === noonTarget,
`current output: ${noonOutput}, target output: ${noonTarget}`,
);

const midnightOutput = formatAs12HourClock("00:00");
const midnightTarget = "12:00 am";
console.assert(
midnightOutput === midnightTarget,
`current output: ${midnightOutput}, target output: ${midnightTarget}`,
);

const singleDigitMinuteOutput = formatAs12HourClock("9:5");
const singleDigitMinuteTarget = "9:05 am";
console.assert(
singleDigitMinuteOutput === singleDigitMinuteTarget,
`current output: ${singleDigitMinuteOutput}, target output: ${singleDigitMinuteTarget}`,
);

console.log("All formatAs12HourClock tests passed.");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Great job testing noon and midnight, which are the edge cases most likely to break this function. Two things to think about: what happens to your final success message if one of the assertions fails, and is "9:5" a valid 24-hour time whose expected output matches the format of your other tests?

@mayowaolokun mayowaolokun 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 Oct 2, 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.

3 participants