Skip to content

Manchester | 26-ITP-Sep |Precious Moses | Sprint 3 | Course-work-3 - #1585

Open
moses77-boop wants to merge 92 commits into
CodeYourFuture:mainfrom
moses77-boop:coursework/sprint-3
Open

moses77-boop wants to merge 92 commits into
CodeYourFuture:mainfrom
moses77-boop:coursework/sprint-3

Conversation

@moses77-boop

@moses77-boop moses77-boop 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 all tasks including using predictions, reusing functions,understanding strings, invoking methods, BMI Calculation, time formatting and checks, conversion programs, using Python tutor code visualizer, and debugging

@netlify

netlify Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for cyf-onboarding-module ready!

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

@moses77-boop moses77-boop 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 Sep 24, 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 Sep 24, 2026
@moses77-boop moses77-boop added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 24, 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 24, 2026
@moses77-boop moses77-boop added 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! Using a regular expression for validation and writing such comprehensive test assertions makes this solution extremely robust. Great job overall—approved!

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 scope error.

Quick question: since the template string already produces the exact result you need, could you return it directly without reassigning the parameter, and how might that improve code simplicity?

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.

Thanks for feedback! I think I might have got carried away. I fixed it.
It would improve code simplicity as it cuts out an unnecessary step.

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 spotting the scope conflict and fixing the code.

Quick question: since decimalNumber * 100 is already a short expression, could you return it directly inside the template string without declaring a separate percentage variable?

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.

Thanks for the feedback. I just enjoy adding more details to my code

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 fixed 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 identifying why passing a number literal in a function definition causes a SyntaxError and fixing it with a proper parameter name.

Quick question: when naming parameters like n, how could choosing a more descriptive name (like number) help anyone reading your code understand its purpose even faster?

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.

Fixed

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 tracing the execution order and explaining why functions without a return statement default to returning undefined.

Quick question: since the function now uses return a * b, why is returning the value rather than using console.log inside the function considered a best practice in JavaScript?

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.

Thanks for the feedback!
Using return is considered as best practice because a function that only uses 'console.log' would not be able to parse output in an expression, but a function that returns a value stays flexible, I could choose not to log 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 spotting how automatic semicolon insertion affects the return statement and fixing it.

Quick question: since the expression a + b is short and simple, why might keeping it on the same line as return (like return a + b;) be preferred over putting it on a new line inside parentheses?

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.

Thanks for the feedback. I enjoy detailing my code. I'll fix 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, handling edge cases for height, and using .toFixed(1) to return a clean string.

Quick question: since .toFixed() converts the number into a string, how might that affect any downstream code if another function tries to perform further mathematical calculations directly on the result of calculateBMI?

@moses77-boop moses77-boop Sep 25, 2026 •

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.

Thanks for the feedback!
From research using turns into a string, rather than real numbers, so if further mathematical calculations are peformed directly on that result in some cases, it produces the wrong answer by joining the values together as text instead of adding them numerically and in other cases it fails strict equality comparison since a string and a number are never treated as equal.
I have made changes to the code so it can handle further mathematical calculations.

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 a robust function that handles extra spaces and validates the input type.

Quick question: since this is a fundamentals exercise, do you think using a regular expression like /\s+/ is necessary, or could a simpler method like .replaceAll() achieve the same 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 transforming the snippet into a reusable function and effectively handling different input lengths using string methods like padStart and padEnd.

Quick question: since your logic relies on removing the trailing 'p', how might your function behave if an input accidentally omits the 'p' or includes extra whitespace?

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 tracing the execution step by step and using temporary tracking variables to verify your answers.

Quick question: while using global variables helped you trace the code here, why can relying on global variables for tracking state be risky in larger applications?

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 thorough edge-case tests and using regular expressions to safely validate the 24-hour time format.

Quick question: since you added robust error handling and comprehensive test assertions, how does writing these tests before or alongside your implementation help you catch unexpected bugs earlier?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 📅 Sprint 3 Assigned during Sprint 3 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants