Cape Town | 27-ITP-September | Sima Nongawuza | Sprint 2 | Coursework-sprint 2 - #1609
simanongawuza wants to merge 27 commits into
Conversation
✅ 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.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Only the following issues need to be fixed:
- https://github.com/CodeYourFuture/Module-JavaScript-Fundamentals/pull/1609/changes#r4175278796
- https://github.com/CodeYourFuture/Module-JavaScript-Fundamentals/pull/1609/changes#r4175304359
- https://github.com/CodeYourFuture/Module-JavaScript-Fundamentals/pull/1609/changes#r4175367019
Others are just comments for your future improvement. Well done and keep it up.
| const dir = ; | ||
| const ext = ; | ||
| const dir = filePath.slice(0, lastSlashIndex); | ||
| const ext = filePath.slice(filePath.lastIndexOf(".") + 1); |
There was a problem hiding this comment.
According to the definition in line 7, the . should also be part of file extension. Please fix it. Thank you.
| // ANSWER | ||
| // num represents a random whole number in the range 0 - 100. | ||
| // math.random gives a random decimal between 0 and 1.math floor rounds the value to a whole number. | ||
| // (maximum - minimum + 1) evaluates the total count of integers. (+ minimum )adds 1 to the outcome. | ||
| // The code starts by evaluating math.random then multiply that by the maximum, math.floor will then round that value into a whole number then finally adding minimum to get num. |
There was a problem hiding this comment.
While your description is correct, it would be better if having a bit of explanation. For example, what does it mean by gives a random decimal between 0 and 1 (or both 0 and 1 included as well), and what is the purpose of then multiply that by the maximum, etc. Please elaborate your answer (don't need to be long, just with a little bit clarity/detail/accuracy). Thank you.
| // line 1,line 2, line 7, line 8 | ||
|
|
||
| // e) Describe what the expression Number(carPrice.replaceAll(",","")) is doing - what is the purpose of this expression? | ||
| // The expression changes the string to a number and removes the comma. This makes it possible for Javascript to perform subtraction since it is no longer a string No newline at end of file |
There was a problem hiding this comment.
A bit of English presentation here, should be ... removes the comma and changes the string to a number. This is because the expression is actually removing commas first before data type conversion, so it would be better to follow the same order of execution when describing it.
| // It calculates the total number of whole minutes in the movie by subtracting the remainingSeconds from the total movie then divides the answer by 60 to covert seconds to minutes. | ||
| // e) What do you think the variable result represents? Can you think of a better name for this variable? | ||
|
|
||
| // This variable represents the movie duration in the form of hours:minutes:seconds. better name id duration. |
There was a problem hiding this comment.
duration may still be not clear enough because const movieLength = 8784; can also be a kind of duration. Can you think of a better name? Thank you.
| // // const pounds = paddedPenceNumberString.substring( | ||
| // 0, | ||
| // paddedPenceNumberString.length - 2 :This takes the first digit of the number in pence since 100 pence = 1 pound therefore coverting pence to pounds | ||
| // ); |
There was a problem hiding this comment.
Again, this may just be English presentation. It "takes out (or remove) the last two digits" rather than "takes the first digit". There is a minor difference between the two angles to present the same thing. While the end result is the same, the explanation can be more accurate.
There was a problem hiding this comment.
Try not to modify the question formatting. This file is in markdown format so that the '##' and '`' should be preserved.

Self checklist
Task code
CYF-1039
Changelist