Skip to content

London | 26-ITP-May | Eyob Zeray | Sprint 2 | Course Work - #1546

Open
eyob-tech wants to merge 1 commit into
CodeYourFuture:mainfrom
eyob-tech:coursework/sprint-2
Open

London | 26-ITP-May | Eyob Zeray | Sprint 2 | Course Work#1546
eyob-tech wants to merge 1 commit into
CodeYourFuture:mainfrom
eyob-tech:coursework/sprint-2

Conversation

@eyob-tech

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

Changelist

Completed Sprint 2 exercises: fixed key errors, debugged and corrected mandatory-debug tasks, implemented BMI/cases/to-pounds functions, and answered the interpretation questions for time-format.js.

@eyob-tech eyob-tech added 📅 Sprint 2 Assigned during Sprint 2 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Structuring-And-Testing-Data The name of the module. labels Jul 22, 2026
@LonMcGregor LonMcGregor added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Jul 27, 2026

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

Good start, one small comment in a file to check

// return the BMI of someone based off their weight and height
} No newline at end of file
const bmi = weight / (height * height);
return Math.round(bmi * 10) / 10;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Is there a better choice than multiplying and then dividing by the same number?

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.

Good point — yeah, toFixed() is simpler for this. Something like Number(bmi.toFixed(1)) would do the same job in one step instead of the multiply/round/divide trick. I'll keep it as is for this PR since it's already passing, but I'll use toFixed() for rounding in future exercises. Thanks for the tip!

@LonMcGregor LonMcGregor 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. Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Jul 27, 2026
@eyob-tech eyob-tech 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 Jul 27, 2026
@eyob-tech
eyob-tech requested a review from LonMcGregor July 27, 2026 16:32
@LonMcGregor

Copy link
Copy Markdown

Yes, dividing and multiplying in javascript is always tricky because of floats, so avoiding it wherever you can is a good idea. toFixed is a more targeted alternative that works well here. I'll mark this as complete now

@LonMcGregor LonMcGregor added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed. Module-Structuring-And-Testing-Data The name of the module. 📅 Sprint 2 Assigned during Sprint 2 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants