Repository navigation
Manchester | 26-ITP-Sep | Mathew Shaibu | Sprint 2 | Coursework/sprint 2 implement and rewrite - #1673
Open
MattCarolus10 wants to merge 107 commits into
Open
MattCarolus10 wants to merge 107 commits into
MattCarolus10 wants to merge 107 commits into
Conversation
…etween 90° and 180°
…ameter for password history
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
LonMcGregor
reviewed
Oct 14, 2026
LonMcGregor
left a comment
There was a problem hiding this comment.
Good start, though I see some areas to improve further
|
|
||
| export function isProperFraction(numerator, denominator) { | ||
| // TODO: Implement this function | ||
| if (numerator < denominator) { |
There was a problem hiding this comment.
A couple of issues with this sequence of if statements:
- It seems rather complex, is there a way to simplify what the concept of a "proper fraction" is?
- An if statement has a boolean condition. You are always returning booleans. Are the if statements needed at all in this case?
Author
There was a problem hiding this comment.
Thank you, that makes total sense. i will simplify it by returning Math.abs(numerator) < Math.abs(denominator) directly without if statements.
| }); | ||
|
|
||
| test(`Should return false when denominator is negative`, () => { | ||
| expect(isProperFraction(1, -2)).toEqual(false); |
There was a problem hiding this comment.
A fraction is proper when the number on top is smaller than the number on bottom. Even though 2 is negative, the size of 1 is smaller than 2 so fractions like -1/2 and 1/-2 are valid proper fractions
Author
There was a problem hiding this comment.
Thank you so much, I have corrected it.
|
Great, this looks good now |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Self checklist
Task code
CYF-1059
Changelist
-implement isValidPassword function with checks for length, previous passwords array, uppercase, lowercase, numbers, and allowed symbols