-
-
Notifications
You must be signed in to change notification settings - Fork 239
West Midlands | 25 Sep ITP | Iswat Bello | Sprint 2 | Coursework Sprint 2 #778
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
base: main
Are you sure you want to change the base?
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.
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code in the function is not properly indented.
This VSCode feature might interest you:
https://code.visualstudio.com/docs/languages/javascript#_formatting
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.