-
-
Notifications
You must be signed in to change notification settings - Fork 195
London | May 2025 | Houssam Lahlah | Acoursework/sprint 2 #672
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
…dle, and last names.
…om file path string using slice.
…ween minimum and maximum.
You made some changes to the "Sprint-1" folder in your Can you revert the changes made in the "Sprint-1" folder? You can download CYF's Note: Your |
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.
Some of the code could use some improvement.
const pounds = kg * 2.20462; | ||
return pounds.toFixed(2); // rounds to 2 decimal places |
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 pounds refer to the British currency.
This exercise the objective is to rewrite the code in Sprint-1/3-mandatory-interpret/3-to-pounds.js
as a function.
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.
Thank you for the feedback. I understand now that the exercise is about converting pence to British pounds, not kilograms to pounds.
I rewrite the code in Sprint-1/3-mandatory-interpret/3-to-pounds.js as a function that takes a pence string (like "399p") and returns the formatted pounds (like "£3.99"), then test it with different inputs.
Let me know if I’ve understood it correctly.
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.
formattedHour = String(hours - 12).padStart(2, "0"); | ||
period = "pm"; | ||
} else { | ||
formattedHour = String(hours).padStart(2, "0"); | ||
period = "am"; | ||
} | ||
return `${time} am`; | ||
|
||
return `${formattedHour}:${minutes} ${period}`; |
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 also consider format the hours with padStart(2, "0")
at line 22 (at one location); less code and make code maintenance easier.
Check List
Changelist :
This PR contains solutions for the Sprint 2 coursework exercises:
key-errors:
Implemented capitalise, convertToPercentage, and fixed square function errors.
mandatory-debug:
Debugged and fixed multiply, sum, and getLastDigit functions.
mandatory-implement:
Implemented calculateBMI, converted strings to upper case, and created reusable toPounds function.
mandatory-interpret:
Added formatTimeDisplay function to convert seconds into HH:MM:SS format.
stretch-extend:
Extended formatAs12HourClock function with edge case handling and added tests.
All functions have been tested with relevant inputs to ensure correctness.
Questions
Is my use of descriptive commit messages clear and helpful for reviewers?
Are there any improvements I could make in code style or function structure based on the style guide?