-
-
Notifications
You must be signed in to change notification settings - Fork 301
West Midlands | May-2025 | Mustaf Asani | Sprint-1 #510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
cjyuan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code is good and explanation is clear. Well done.
I only have a few suggestions and comments.
| // 2. const penceStringWithoutTrailingP = penceString.substring(0, penceString.length - 1): removes the trailing 'p' from the string by using the substring method and passing it the start index (0) and the end index (length - 1) returning "399". | ||
| // 3. const paddedPenceNumberString = penceStringWithoutTrailingP.padStart(3, "0"): pads the string with leading zeros to ensure it has at least 3 characters, resulting in "399" remaining unchanged. | ||
| // 4. const pounds = paddedPenceNumberString.substring(0, paddedPenceNumberString.length - 2): extracts the pounds part of the string by taking all characters except the last two, resulting in "3". | ||
| // 5. const pence = paddedPenceNumberString.substring(paddedPenceNumberString.length - 2).padEnd(2, "0"): extracts the last two characters of the string and pads it with trailing zeros if necessary, resulting in "99" since it already has two characters. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we expect this program to work as intended for any valid penceString if we deleted .padEnd(2, "0") from the code?
In other words, do we really need .padEnd(2, "0") in this script?
cjyuan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A commit with the message "updating to remote" have changed all the files in your branch (which also affected your Sprint-2 branches). You probably did not setup CRLF conversion properly.
You could fix the problem via
- Git commands (Ask ChatGPT
what should i do if my previous push to GitHub did not convert the CR/LF properly?), or - Create a new branch from your
mainbranch, then transfer your files to the new branch, and commit the files in the proper folders.
If you choose option (2), you can also practice committing files one by one, on purpose, and for a reason. In VSCode, you can select which file to stage, and commit only the staged file. See: https://www.youtube.com/watch?v=z5jZ9lrSpqk&t=705 (At around 12:50 minute marker, the video shows how to stage a single file).
Please fix the branch. You should also do the same for your Sprint-2 branch.

Learners, PR Template
Self checklist
Changelist
Completed all the tasks in sprint 1
Questions
Ask any questions you have for your reviewer.