Skip to content

Conversation

@MohammedNaru
Copy link

@MohammedNaru MohammedNaru commented Nov 3, 2025

Sprint 2 Coursework

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 coursework tasks on Sprint 2

Questions

No questions currently

@github-actions
Copy link

github-actions bot commented Nov 3, 2025

Your PR's title isn't in the expected format.

Please check the expected title format, and update yours to match.

Reason: Sprint part (Sprint-2) doesn't match expected format (example: 'Sprint 2', without quotes)

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

@MohammedNaru MohammedNaru changed the title West Midlands | Sept-ITP-2025 | Ali Naru | Sprint-2 | Coursework/sprint-2 West Midlands | 25-ITP-Sept | Ali Naru | Sprint-2 | Coursework/sprint-2 Nov 3, 2025
@github-actions
Copy link

github-actions bot commented Nov 3, 2025

Your PR's title isn't in the expected format.

Please check the expected title format, and update yours to match.

Reason: Sprint part (Sprint-2) doesn't match expected format (example: 'Sprint 2', without quotes)

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

@MohammedNaru MohammedNaru changed the title West Midlands | 25-ITP-Sept | Ali Naru | Sprint-2 | Coursework/sprint-2 West Midlands | 25-ITP-Sep | Ali Naru | Sprint 2 | Coursework/sprint-2 Nov 3, 2025
@MohammedNaru MohammedNaru changed the title West Midlands | 25-ITP-Sep | Ali Naru | Sprint 2 | Coursework/sprint-2 West Midlands | 25-ITP-Sept | Ali Naru | Sprint 2 | Coursework/sprint-2 Nov 3, 2025
@MohammedNaru MohammedNaru 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 Nov 3, 2025

function calculateBMI(weight, height) {
const bmi = weight / (height * height);
return bmi.toFixed(1);
Copy link
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?

Different types of values may appear identical in the console output, but they are represented and treated differently in the program. For example,

  console.log(123);              // Output 123
  console.log("123");            // Output 123
  
  // Treated differently in the program
  let sum1 = 123 + 100;         // Evaluate to 223 -- a number
  let sum 2 = "123" + 100;      // Evaluate to "123100" -- a string.

Copy link
Author

Choose a reason for hiding this comment

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

All updated now please can you review again.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you also answer my questions in this thread?

Copy link
Author

Choose a reason for hiding this comment

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

I expect the function to return a number, because BMI is a numeric value that can be used in further comparisons or calculations. In my earlier implementation, using .toFixed(1) caused the function to return a string instead of a number. Although the string appears the same in the console I understand it operates differently I have now updated the function so that it returns a number by converting the result back with parseFloat().

Copy link
Contributor

Choose a reason for hiding this comment

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

If you have updated the file, don't forget to push the changes to GitHub.

@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 Nov 8, 2025
@MohammedNaru MohammedNaru 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 Nov 15, 2025
@cjyuan
Copy link
Contributor

cjyuan commented Nov 15, 2025

You missed one of my questions.

Also, the description of this PR written in the "Changelist" section does not quite tell me what was changed in this PR branch.

@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 Nov 15, 2025
@MohammedNaru MohammedNaru 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 Nov 15, 2025
@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. labels Nov 15, 2025
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