Skip to content

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

Open
wants to merge 40 commits into
base: main
Choose a base branch
from

Conversation

CatchingKiyoko
Copy link

Learners, PR Template

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with REGION | COHORT_NAME | FIRST_NAME LAST_NAME | PROJ_NAME
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

  1. Implemented changes and fixes to files.
  2. added comments detailing ,explaining code and answered questions with comments.
  3. refactored some lines to make neater and easier to read.
  4. added tests with jest.

Briefly explain your PR.

Questions

Ask any questions you have for your reviewer.

…CardValue function with comments explaining function and updated tests
@CatchingKiyoko CatchingKiyoko added 📅 Sprint 3 Assigned during Sprint 3 of this module Needs Review Participant to add when requesting review labels Jun 28, 2025
Comment on lines +4 to 12
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";
}
Copy link
Contributor

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".

Copy link
Contributor

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.

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review and removed Needs Review Participant to add when requesting review labels Jul 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Reviewed Volunteer to add when completing a review 📅 Sprint 3 Assigned during Sprint 3 of this module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

02 Complete Sprint 3 coursework
2 participants