-
-
Notifications
You must be signed in to change notification settings - Fork 242
West Midlands | 25-ITP-Sept | Ali Naru | Sprint 2 | Coursework/sprint-2 #840
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
West Midlands | 25-ITP-Sept | Ali Naru | Sprint 2 | Coursework/sprint-2 #840
Conversation
…ons and explanations
|
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). |
…vertToPercentage function
…ons and explanations
… and explanations
…ions and explanations
…time formatting questions
|
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). |
|
|
||
| function calculateBMI(weight, height) { | ||
| const bmi = weight / (height * height); | ||
| return bmi.toFixed(1); |
There was a problem hiding this comment.
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.There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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().
There was a problem hiding this comment.
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.
|
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. |
Sprint 2 Coursework
Self checklist
Changelist
Completed all coursework tasks on Sprint 2
Questions
No questions currently