London | 26-ITP-May | Alex Jamshidi | Sprint 2 | Coursework#1316
London | 26-ITP-May | Alex Jamshidi | Sprint 2 | Coursework#1316Alex-Jamshidi wants to merge 8 commits into
Conversation
illicitonion
left a comment
There was a problem hiding this comment.
Generally LGTM, but a couple of things to look at.
| // Uncaught SyntaxError: Identifier 'decimalNumber' has already been declared | ||
| // As predicted the function is trying to declare a variable that has already been determined | ||
|
|
||
| // Finally, correct the code to fix the problem |
There was a problem hiding this comment.
Does this file now do what you'd expect when you run it?
There was a problem hiding this comment.
Not a very useful function if input is immediately ignored
removed variable line entirely so percentage is calculated from function argument
There was a problem hiding this comment.
I don't see this update - are you sure you committed+pushed?
| @@ -15,5 +15,5 @@ | |||
| // It should return their Body Mass Index to 1 decimal place | |||
|
|
|||
| function calculateBMI(weight, height) { | |||
There was a problem hiding this comment.
Try calling this function - does it calculate the value you expect?
(e.g. with the example given of 70 and 1.73 which has an expected answer. Or try 50 and 2 - what do you get?)
There was a problem hiding this comment.
ah!
I assumed that ^ was going to raise to the power as in scientific notation.
When I tested for 70 1.73, it was so close that I assumed it was a rounding error in the question. :')
I understand ^ is not that at all, have updated code to ** 2 for powers
There was a problem hiding this comment.
Makes sense!
For the future, if you think the expected outputs we give you for exercises are wrong, please raise it with us so we can fix them (or work out they're actually right)! :)
Learners, PR Template
Self checklist
Changelist
Completed solutions to sprint 2 coursework