Skip to content

Cape Town | 26-ITP-May | Shafiek Walker | Sprint 2 | Coursework Exercises#1388

Open
shafiekwalker7861 wants to merge 8 commits into
CodeYourFuture:mainfrom
shafiekwalker7861:coursework/sprint-2
Open

Cape Town | 26-ITP-May | Shafiek Walker | Sprint 2 | Coursework Exercises#1388
shafiekwalker7861 wants to merge 8 commits into
CodeYourFuture:mainfrom
shafiekwalker7861:coursework/sprint-2

Conversation

@shafiekwalker7861

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 all Sprint 2 mandatory exercises, including debugging, implementing functions, interpreting code, and stretch exercises. All code was tested before submission.

@shafiekwalker7861 shafiekwalker7861 added 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 Jun 23, 2026
Comment thread Sprint-2/3-mandatory-implement/1-bmi.js Outdated

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

What type of value do you expect your function to return? A number or a string?
Does your function return the type of value you expect?

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 updated the function so it now returns a number instead of a string by using Number(...) around the toFixed() result.

Comment on lines +38 to +43
const currentOutput3 = formatAs12HourClock("12:00");
const targetOutput3 = "12:00 pm";
console.assert(
currentOutput3 === targetOutput3,
`current output: ${currentOutput3}, target output: ${targetOutput3}`
);

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 do you expect from the following function calls?

formatAs12HourClock("00:34");
formatAs12HourClock("12:34");
formatAs12HourClock("01:01");
formatAs12HourClock("13:01");
  • Does your function return the value you expected?
  • Are the return values consistently formatted?

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! I added tests for these edge cases, updated the function to preserve the minutes, and made the formatting consistent for all the cases you mentioned.

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

cjyuan commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Changes look good.

@cjyuan cjyuan 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. Reviewed Volunteer to add when completing a review with trainee action still to take. labels Jun 28, 2026
@shafiekwalker7861

Copy link
Copy Markdown
Author

Thanks @cjyuan , Much apprciated.

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants