Skip to content

Birmingham | ITP-Jan-26 | Ayodeji Ayorinde | Sprint 2 | Structuring and Testing Data#1193

Open
Ayogit1 wants to merge 3 commits intoCodeYourFuture:mainfrom
Ayogit1:acoursework/sprint-2
Open

Birmingham | ITP-Jan-26 | Ayodeji Ayorinde | Sprint 2 | Structuring and Testing Data#1193
Ayogit1 wants to merge 3 commits intoCodeYourFuture:mainfrom
Ayogit1:acoursework/sprint-2

Conversation

@Ayogit1
Copy link

@Ayogit1 Ayogit1 commented Mar 6, 2026

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

This the complete of Sprint 2 tasks

@Ayogit1 Ayogit1 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 6, 2026
// The last digit of 806 is 3
// Explain why the output is the way it is
// =============> write your explanation here
// =============> write your explanation here. num is a constant variable, it's value cannot change.
Copy link
Contributor

Choose a reason for hiding this comment

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

You fixed the bug, but it is not because of the reason you described on line 23. (You could replace the const on line 7 by let and the code would still produce the same result).

Can you use AI to help you figure out the actual reason, and revise your explanation?


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

  • Have you tested your function to see if it returns the correct value? For example, what value do you expect calculateBMI(22.34, 1) to return? Does your function return the value you expect?

  • In addition, 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.

// You will need to come up with an appropriate name for the function
// Use the MDN string documentation to help you find a solution
// This might help https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase
function upCase(strCar) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The current function name does not quite tell people it returns the converted string in upper snake case format.

Can you suggest a more descriptive function name?

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

Labels

Reviewed Volunteer to add when completing a review with trainee action still to take.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants