Manchester | 26-ITP-Sep | Mathew Shaibu | Sprint 2 | Course-work-2 - #1546
MattCarolus10 wants to merge 68 commits into
Conversation
✅ Deploy Preview for cyf-onboarding-module ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Thank you very much |
| const dir = filePath.slice(0, lastSlashIndex); | ||
| console.log(`The dir part of ${filePath} is ${dir}`); | ||
|
|
||
| const ext = base.slice(4); |
There was a problem hiding this comment.
The file name does not necessary 4 characters long. It can be longer and shorter (e.g. considering /path/to/screenshot.png). Cutting out the first 4 characters does not necessary remain the file extension. Please fix it, thank you.
There was a problem hiding this comment.
Thank you for this review, I have checked and found out the right solution. Appreciate
There was a problem hiding this comment.
The revised solution is much better. However, according to definition in line 7, the . should also be considered as file extension. So please fix this minor issue as well. Thank you.
| // num variable that carries the result of the expressions evaluated. | ||
| // (maximum - minimum) does basic math: 100 - 1 + 1 = 100 | ||
| // Math.floor() takes out all decimal and make them an integer. | ||
| // Math.random() gives random numbers between 0 and 100. | ||
| // + minimum add 1 at the end but randomise to the value between 0 and 100 No newline at end of file |
There was a problem hiding this comment.
Math.random()itself does not give a number between 0 to 100.+ minimumwould not randomise value.- The explanation require a bit more details and clarity.
- It would be better for your breakdown to following the same order of expression evaluation.
Please fix and elaborate you answer, thank you.
There was a problem hiding this comment.
Thank you, review acknowledged
| const HourClockTime1 = "8:53pm"; | ||
| const hourClockTime2 = "20:53"; | ||
| console.log(`${HourClockTime1}, ${hourClockTime2}`) |
There was a problem hiding this comment.
While this fixed the error, can you think of better variable names? Thank you.
There was a problem hiding this comment.
Variable names changed, thank you
|
|
||
| // e) Describe what the expression Number(carPrice.replaceAll(",","")) is doing - what is the purpose of this expression? | ||
|
|
||
| // Answer: ReplaceAll() function clears out all the commas in the strings, the number() converts the strings to numbers to help with calculation |
There was a problem hiding this comment.
JavaScript is case sensitive. It should be "The Number() converts ..."
There was a problem hiding this comment.
Thank. you, Error corrcted.
|
|
||
| // f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer | ||
|
|
||
| // Answer: It will work for integer values and will give us clear and clean result using this code. However, the result would not be clean as this using float values |
There was a problem hiding this comment.
One more situation that make this program won't work well even an integer value is provided. Can you think of it?
There was a problem hiding this comment.
I will check and make research to see
| // Also, line 3-6 used the function substring(0, penceString.lrength - 1) to cut out the "p" in the "penceString" variable. | ||
| // By starting count fron 0 (beginnning) of "399p". | ||
| // "Using penceString.lenght - 1" to check the length of the value in the variable penceString = "399p" (4), | ||
| // And deducting 1 from the value (4 - 1), because length - 1 subtract 1 from the character/value count 4. leaving the value at "399" |
There was a problem hiding this comment.
While the result of getting "399" is correct, the explanation seems not quite accurate to me.
- it is not counting, it should be indexing
- the reason for deducting 1 is due to how the second parameter of
substring()works
Please revise your answer. Thank you.
There was a problem hiding this comment.
My explanation is due to my level of understanding, I need to work on my terminologies usage going forward. Thank you
There was a problem hiding this comment.
Much clearer and more accurate now, good job! Explaining code is an important skill as a software developer, and keep practicing and you will be fine. Cheers!
| // And deducting 1 from the value (4 - 1), because length - 1 subtract 1 from the character/value count 4. leaving the value at "399" | ||
|
|
||
| // Line 8 a variable "paddedPenceNumberString" was created and a function padStart(3, "0") | ||
| // was used to ensure the value of the variable remains at 3 and to be filled with "0" at the beginning if the value is less 3 |
There was a problem hiding this comment.
Your understanding might be correct but the presentation seems not quite right. What does the "value" in your explanation "the value of the variable remains at 3" mean? Can you revise the wording a bit please? Thank you.
p.s.: same issue with line 50-51 below, and please revise it as well.
There was a problem hiding this comment.
Thank you so much for all your reviews, I really appreciate them and I have taken notes of the corrections.
There was a problem hiding this comment.
Lines 50-51 now becomes lines 47-48, please fix them as well. Thank you.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1aca2c1 to
9cbdc83
Compare
| // "num" variable carries the result/value of the expressions evaluated. | ||
| // (maximum - minimum) workout the size of the range: 100 - 1 + 1 = 100 | ||
| // Math.floor() takes out all decimal and make them a whole number from 0 to 99. | ||
| // Math.random() gives a decimal from 0 up to just under 1 (0.9999999). | ||
| // + minimum add 1 to the expression at the end because it is decleared a variable. No newline at end of file |
There was a problem hiding this comment.
The revised explanation looks much better now. Just a few minor issues to fix further:
Math.random()inside the(... * ...)would be evaluated before Math.floor() outside of it. So it would be better to swap lines 10 and 11 in your explanation.+ minimumat the end is not because of "it is declared a variable". This final part has its own purpose in this program. Can you think of the purpose of adding minimum at the end?
There was a problem hiding this comment.
Thank you so much, I have fixed all errors now.
|
Thanks for your updated code and so far looked good to me. You are almost there and now just remaining the following issues. Would you please fix them as well?
|
|
I definitely will fix them. Thanks so much for reviewing my work
Sent from Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
From: hackertainment ***@***.***>
Sent: Saturday, 26 September 2026 16:16:08
To: CodeYourFuture/Module-JavaScript-Fundamentals ***@***.***>
Cc: Mathew Shaibu ***@***.***>; Author ***@***.***>
Subject: Re: [CodeYourFuture/Module-JavaScript-Fundamentals] Manchester | 26-ITP-Sep | Mathew Shaibu | Sprint 2 | Course-work-2 (PR #1546)
[https://avatars.githubusercontent.com/u/259196870?s=20&v=4]hackertainment left a comment (CodeYourFuture/Module-JavaScript-Fundamentals#1546)<#1546 (comment)>
Thanks for your updated code and so far looked good to me. Now just remaining the following two issues. Would you please fix them as well?
* #1546 (comment)<#1546 (comment)>
* #1546 (comment)<#1546 (comment)> (I have also mentioned about rephrasing line 50-51, now 47-48, as well. The lines are listed below for reference.)
// The "substring(paddedPenceNumberString.length - 2)" function deducts 3 leaving the last two numbers 99
// PadEnd(2, "0") ensure the value remains 2 and 0 to be added to value less than 2.
—
Reply to this email directly, view it on GitHub<#1546?email_source=notifications&email_token=B4W43WLPJRRV4TVEEJ7MC535Q7MTRA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKOBUG4ZTQNZYGYYKM4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#issuecomment-5847387860>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/B4W43WILRGTKXMNHK5FAZ7L5Q7MTRAVCNFSNUABFKJSXA33TNF2G64TZHM4DSOJQGI2DGMRUHNEXG43VMU5TKNJRGM2DCMRXGQ22C5QC>.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS<https://github.com/notifications/mobile/ios/B4W43WIZQ7VOEVLKERHNXAT5Q7MTRA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKOBUG4ZTQNZYGYYKM4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KUZTPN52GK4S7NFXXG> and Android<https://github.com/notifications/mobile/android/B4W43WOHUOFIWBPT2W35QXT5Q7MTRA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKOBUG4ZTQNZYGYYKM4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2K4ZTPN52GK4S7MFXGI4TPNFSA>. Download it today!
You are receiving this because you authored the thread.Message ID: ***@***.***>
|

Self checklist
Task code
CYF-1039
Changelist
Questions
Most functions in this project are new to me, even though I have been able to understand their functions individually, I am not really confident to code with them. I will keep practicing and any advise would really be appreciated.