West Midlands | 25 Sep ITP | Iswat Bello | Sprint 2 | Coursework Sprint 2#778
West Midlands | 25 Sep ITP | Iswat Bello | Sprint 2 | Coursework Sprint 2#778Iswanna wants to merge 22 commits intoCodeYourFuture:mainfrom
Conversation
…S files accordingly
…rtions to compare current output with target output
…, and write the correct code.
…fy the issue, and add the corrected code.
- Predict the behavior of the existing code and provide explanations. - Include any error messages encountered during execution. - Provide the corrected code to fix the errors.
- Predict what will happen when the program runs. - Write the correct code to fix any errors.
…, and fix the code.
… produce the expected results.
cjyuan
left a comment
There was a problem hiding this comment.
So far so good.
There are a few more files in 3-mandatory-implement and 4-mandatory-interpret.
The files in the prep folder is not quite related to the Sprint-2 exercise. To keep the branch clean, can you delete the folder from this branch?
Hi @cjyuan. Thank you for the helpful feedback and for spotting the missing updates in the I’ve also removed the |
| function toPounds(penceString) { | ||
| const penceStringWithoutTrailingP = penceString.substring( | ||
| 0, | ||
| penceString.length - 1 | ||
| ); | ||
|
|
||
| const paddedPenceNumberString = penceStringWithoutTrailingP.padStart(3, "0"); | ||
| const pounds = paddedPenceNumberString.substring( | ||
| 0, | ||
| paddedPenceNumberString.length - 2 | ||
| ); | ||
|
|
||
| const pence = paddedPenceNumberString | ||
| .substring(paddedPenceNumberString.length - 2) | ||
| .padEnd(2, "0"); | ||
|
|
||
| return `£${pounds}.${pence}`; | ||
|
|
||
| // console.log(`£${pounds}.${pence}`); | ||
| } |
There was a problem hiding this comment.
The code in the function is not properly indented.
This VSCode feature might interest you:
https://code.visualstudio.com/docs/languages/javascript#_formatting
There was a problem hiding this comment.
The code in the function is not properly indented.
Hi @cjyuan.
Thank you for the feedback. I’ve fixed the inconsistent code indentation.
|
You did great. Thanks for making this PR easy to review. |
Hi @cjyuan. Thank you! I’m glad the changes were clear. I really appreciate your feedback and review. |
Learners, PR Template
Self checklist
Changelist
In this pull request, I completed the following:
Reviewed each file in the 1-key-errors directory, predicted the runtime errors, ran them with Node, and explained why each error occurred using the documentation.
Examined files in the 2-mandatory-debug directory, predicted why the programs were misbehaving, ran them to confirm, and corrected the code.
Implemented functions in the 3-mandatory-implement directory according to the provided requirements and tested them with multiple inputs to ensure correctness.
Analyzed larger programs in the 4-mandatory-interpret directory, researched unfamiliar syntax and functions, and used console.log to verify variable values and program flow.
Questions
Hi. Please could you review my PR? I’d really appreciate your feedback.