-
-
Notifications
You must be signed in to change notification settings - Fork 193
Sheffield | May-2025 | Declan Williams | Sprint-3 #623
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?
Sheffield | May-2025 | Declan Williams | Sprint-3 #623
Conversation
… corresponding test case
…angles in getAngleType function
…d corresponding test case
…add corresponding test case
…d corresponding test case
…CardValue function with comments explaining function and updated tests
…ction and add corresponding test cases
…test for special ordinal numbers
…comments detailing.
if (angle < 90) | ||
return "Acute angle"; | ||
if ((angle > 90) && (angle < 180)) | ||
return "Obtuse angle"; | ||
if (angle === 180) | ||
return "Straight angle"; | ||
if ((angle > 180) && (angle < 360)) | ||
return "Reflex angle"; | ||
} |
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.
Your function can return undefined
for some values of angle
. To ensure reliability, please update the function so it always returns a defined value (which can be "Invalid angle") or throws an error. Functions that are expected to return a result should never return undefined
.
Note: the spec fails to mention angles <= 0 are not "Acute angle".
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.
In mathematics, -4/7 == 4/-7, and -4/-7 == 4/7.
So, ideally isProperFraction()
should recognise all of them as proper fractions.
Similarly, -5/2 == 5/-2, and -5/-2 == 5/2.
So isProperFraction(-5, 2)
should also return false
because -5/2 is not a proper fraction. (Currently your function return true
)
Hint: we can compare the absolute value of both parameters instead.
Learners, PR Template
Self checklist
Changelist
Briefly explain your PR.
Questions
Ask any questions you have for your reviewer.