London | 26-ITP-May | Chun Yan Wong | Sprint 2 | CourseWork#1472
London | 26-ITP-May | Chun Yan Wong | Sprint 2 | CourseWork#1472cywong-dev wants to merge 12 commits into
Conversation
Added a comment explaining potential uncaught type error.
Commented out code to prevent uncaught type error for empty strings.
Define decimalNumber in the main function to avoid undefined error.
Added comments explaining the error and its correction.
Added return statement to the multiply function to ensure it returns the product of the two numbers.
Fixed the sum function to return the correct result by including the addition operation in the return statement.
Fixed getLastDigit function to return the correct last digit for integers.
Implemented the toPounds function to convert pence to pounds.
Fix bugs related to formatting time in 12-hour clock.
There was a problem hiding this comment.
It looks like there is quite a bit missing from these tasks - could you have another look at these please?
For the "key errors" tasks, Have you tried implementing your suggestions to see if it fixed the problem?
You don't need to include your name in comments, git lets us know who wrote what
| // Finally, correct the code to fix the problem | ||
| // =============> write your new code here | ||
| // [ChunYanWong] | ||
| // console.log(a * b); |
There was a problem hiding this comment.
Do you need the console.log in the function if you also have one outside when calling it?
|
|
||
| // Finally, correct the code to fix the problem | ||
| // =============> write your new code here | ||
| // [ChunYanWong] return (a+b); |
There was a problem hiding this comment.
Do you need the surrounding brackets here?
| function calculateBMI(weight, height) { | ||
| // return the BMI of someone based off their weight and height | ||
| } No newline at end of file | ||
| return Math.round((weight/(height*height)*10))/10; |
There was a problem hiding this comment.
Here your solution involved multiplying by 10 and then dividing by 10. Is there a different function you could use that could simplify this?
| // This might help https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase | ||
|
|
||
| function toUpperCase(words) { | ||
| return words.toUpperCase(); |
There was a problem hiding this comment.
Can you read the task spec again. Have you implemented everything it asked?
Learners, PR Template
Self checklist
[X] I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
[X] My changes meet the requirements of the task
[X] I have tested my changes
[X] My changes follow the style guide
Changelist
The Changelist is for the solution of the coursework in Sprint 2