London | 26-ITP_May | Vito Moratti | Sprint 2 | Coursework/sprint 2#1429
London | 26-ITP_May | Vito Moratti | Sprint 2 | Coursework/sprint 2#1429vmoratti wants to merge 44 commits into
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
LonMcGregor
left a comment
There was a problem hiding this comment.
Good start, and well done on attempting the stretch task. I've left a couple of comments for further improvements
| // return the BMI of someone based off their weight and height | ||
| } No newline at end of file | ||
| let bmi = weight / (height **2 )// weight divided by height squared. | ||
| return `Your Body Mass Index is ${bmi.toFixed(1)} units`// toFixed(1) insures that result is displayed |
There was a problem hiding this comment.
Have a look at the comment above. It says the function should "return their Body Mass Index to 1 decimal place". Your function works, but does it meet this specific criteria?
There was a problem hiding this comment.
Sorry, but i don't understand what am I missing. The function returns correct BMI with one decimal place using "bmi.toFixed(1)" method
There was a problem hiding this comment.
Your calculation is correct, but read carefully what the task is asking for. It says
It should return their Body Mass Index to 1 decimal place
Is that what your function does? You are returning a string here.
There was a problem hiding this comment.
Oh, I see. I got overly enthusiastic with the result, when only bmi number is expected.
Thank you for pointing that out.
Refactor formatAs12HourClock function to improve readability and fix output format. Adjust test cases to match expected output format without spaces.
|
Good work on the time task - it is done now. See my earlier comment about the BMI calc. |
Updated the calculateBMI function to return only the BMI value with one decimal place instead of a full message.
LonMcGregor
left a comment
There was a problem hiding this comment.
Correct. Typically a function will do one task, and a different function will handle presentation
Learners, PR Template
Self checklist
Changelist
I have completed all the exercises in the course work.