Skip to content

West Midlands | May 2026 | Muhammad-Burhan Mustafa | Sprint 2 | Module-Structuring-and-Testing-Data#1443

Open
burhan-mustafa wants to merge 14 commits into
CodeYourFuture:mainfrom
burhan-mustafa:coursework/sprint-2
Open

West Midlands | May 2026 | Muhammad-Burhan Mustafa | Sprint 2 | Module-Structuring-and-Testing-Data#1443
burhan-mustafa wants to merge 14 commits into
CodeYourFuture:mainfrom
burhan-mustafa:coursework/sprint-2

Conversation

@burhan-mustafa

@burhan-mustafa burhan-mustafa commented Jul 2, 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

Changelist

All tasks in sprint 2 completed.

@burhan-mustafa burhan-mustafa added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 📅 Sprint 2 Assigned during Sprint 2 of this module Module-Structuring-And-Testing-Data The name of the module. Core This is a core task and should be completed by all trainees labels Jul 2, 2026
@Liam310 Liam310 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 Jul 7, 2026
Comment thread Sprint-2/3-mandatory-implement/1-bmi.js Outdated
Comment on lines +18 to +21
let numWeight = Number(weight.slice(0, -2));
let numHeight = Number(height.slice(0, -1));
let BMI = numWeight / (numHeight * numHeight);
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.

Generally if we are designing a function to perform a calculation, it's reasonable to expect the inputs to be numerical. When the function description says "weight in kg", it isn't asking explicitly to accept the input of "70kg" but rather to accept the input of 70 and write a function that interprets that as a kg value of weight.

return string.toUpperCase().replaceAll(" ", "_");
}

console.log(upperSnakeCase("i love cyf you guys are awesome!"));

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 will need to declare a function called toPounds with an appropriately named parameter.

// You should call this function a number of times to check it works for different inputs
function ToPounds(penceString) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

In JavaScript, standard variables and functions should be named with lowerCamelCase style, not UpperCamelCase. When we declare something with UpperCamelCase, as you have done here, we're actually suggesting it is something called a constructor or class (which you don't need to learn about right now, just know that that's not what we're doing here!)


// Explain why the output is the way it is
// =============> write your explanation here
// // Line 7 uses the const variable num which has been assigned the value 103 and the last digit of that number is 3. When the function getLastDigit is called 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.

Would the behaviour be different if it were a let variable?


// =============> write your explanation here
// Since the parameter and variable have the same name, decimalNumber, we will get an error as we can not declare a
// variable of the same name with in the functions local scope

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What's another problem with the original code?

@Liam310 Liam310 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 Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Core This is a core task and should be completed by all trainees Module-Structuring-And-Testing-Data The name of the module. Reviewed Volunteer to add when completing a review with trainee action still to take. 📅 Sprint 2 Assigned during Sprint 2 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants