Repository navigation
Conversation
Added comments to explain variable declaration and assignment.
✅ Deploy Preview for cyf-onboarding-module ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Removed placeholder comments and explanations in time-format.js.
This comment has been minimized.
This comment has been minimized.
Added comments to explain the behavior of the pad function and its calls in formatTimeDisplay.
This comment has been minimized.
This comment has been minimized.
|
Before I can review your Sprint 3 work, this PR needs to change Sprint 3 files only. At the moment it also changes 5 Sprint 2 files, which is why the bot keeps taking the Needs Review label off:
Your Sprint 2 work is already completed. It's in your Sprint 2 PR (#1553), which is already marked Complete. So we can simply remove the Sprint 2 files from this PR:
If anything looks different from what I've described, or you get an error, post a screenshot here and I'll help you through it. |
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Removed duplicate comment and fixed typo.
There was a problem hiding this comment.
Thanks for clearing out the Sprint 2 files. Your answers are right almost everywhere, however, there are there are still few issues to resolve before I can mark it Complete:
- Four files stop with an error before they reach your fix:
1-key-errors/0.js,1.js,2.jsand2-mandatory-debug/2.js. Put//in front of the original code in each, runnodeon the file, and check your new code prints what you expect. 1-key-errors/1.jsline 25 has a strayca.2-mandatory-debug/2.jsline 30 declaresnuma second time.time-format.jsb): check which valuepadgets first (line 36).1-bmi.js: callcalculateBMIwith an example and print the result.- Format Document on
1-key-errors/1.jsand2.jsand save.
Add the Needs Review label again when you've pushed.
| str = `${str[0].toUpperCase()}${str.slice(1)}`; | ||
| return str; | ||
| } | ||
| console.log(capitalise("mother")); |
There was a problem hiding this comment.
Run node 0.js: node stops at line 14 with the SyntaxError, so this line never runs. Put // in front of lines 13 to 16, the original code. Lines 6 to 10 and 20 to 22 do the same thing now, so you only need one of them.
| // =============> write your new code here | ||
| function convertToPercentage(decimalNumber) { | ||
| const percentage = `${decimalNumber * 100}%`; | ||
| ca |
There was a problem hiding this comment.
What is ca doing here? Once lines 10 to 17 are in comments, run the file and see what node says about it.
| // =============> write your prediction of the error here | ||
| // =============> write your prediction of the error here:We will have a SyntaxError because we need a valid function parameter. | ||
|
|
||
| function square(3) { |
There was a problem hiding this comment.
Your explanation is right. Now put // in front of lines 8 to 10, so that node can run your fixed square on line 20. This also lets Format Document work on the file.
| // Finally, correct the code to fix the problem | ||
| // =============> write your new code here | ||
| // =============> write your new code here: | ||
| const num = 103; |
There was a problem hiding this comment.
node stops here: SyntaxError: Identifier 'num' has already been declared, because line 6 already made num. Put the original code (lines 6 to 14) in comments. Then does your new getLastDigit need this line at all?
| //totalMinutes = (61 - 1) / 60 → 1 | ||
| //remainingMinutes = 1 % 60 → 1 | ||
| //totalHours = (1 - 1) / 60 → 0 | ||
| //num = 1 |
There was a problem hiding this comment.
Line 15 calls pad(totalHours) first. On line 35 you worked out totalHours is 0, and your answer to c) starts from 0 too. So what is num the first time?
| function calculateBMI(weight, height) { | ||
| // return the BMI of someone based off their weight and height | ||
| const bmi = weight / (height * height); | ||
| return bmi.toFixed(1); |
There was a problem hiding this comment.
toFixed(1) gives the string the spec asks for. Good. Call it with the example from line 5 and print the result: do you get "23.4"? Your other two implement files already do this.

Learners, PR Template
Self checklist
Task code
CYF-1053
Changelist
oursework/sprint 3
Questions