Sheffield | 26-Jan-ITP | Seti Mussa | Sprint 3 | coursework implement and rewrite #1276
Closed
Seti-Jemal wants to merge 10 commits intoCodeYourFuture:mainfrom
Closed
Sheffield | 26-Jan-ITP | Seti Mussa | Sprint 3 | coursework implement and rewrite #1276Seti-Jemal wants to merge 10 commits intoCodeYourFuture:mainfrom
Seti-Jemal wants to merge 10 commits intoCodeYourFuture:mainfrom
Conversation
Implement the getAngleType function to classify angles and add tests for various cases.
Implemented the isProperFraction function to check if the numerator is less than the denominator. Added tests for various cases including proper fractions, improper fractions, and edge cases.
Implemented the getCardValue function to determine the value of a card based on its rank and suit. Added error handling for invalid cards and wrote initial test cases.
Fix typos in suit and rank validation checks, and correct error throwing.
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.
cjyuan
reviewed
Mar 20, 2026
Contributor
cjyuan
left a comment
There was a problem hiding this comment.
This exercise has a 2nd part.
Can you also update the three files in Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest?
Comment on lines
17
to
36
| function getAngleType(angle) { | ||
| // TODO: Implement this function | ||
| function getAngleType(angle) { | ||
| if (angle <= 0 || angle >= 360) | ||
| } | ||
|
|
||
| if (angle < 90) { | ||
| return "actue angle"; | ||
| } | ||
| if (angle === 90) { | ||
| return "right angle"; | ||
| } | ||
| if (angle < 180){ | ||
| return "obtuse angle"; | ||
| } | ||
| if (angle === 180){ | ||
| return "straight angle"; | ||
| } | ||
| if (angle < 360){ | ||
| return "reflext angle"; | ||
| } |
Contributor
There was a problem hiding this comment.
The file has syntax errors and the indentation is off. Can you fix them?
Comment on lines
+14
to
+18
| if (numerator < denominator) { | ||
| return true; | ||
| } else { | ||
| return false; | ||
| } |
Contributor
There was a problem hiding this comment.
-
Indentation is off. Have you installed the prettier VSCode extension and enabled "Format on save/paste" on VSCode, as recommended in
https://github.com/CodeYourFuture/Module-Structuring-and-Testing-Data/blob/main/readme.md
? -
Can you lookup if -1/-2, 1/-2, -1/2 are considered proper fractions, and then update
your implementation and tests accordingly?
Comment on lines
+25
to
38
| const rank = card.slice(0, -1); | ||
| const suit = card.slice(-1); | ||
|
|
||
| const vaildSuits = [""♠", "♥", "♦", "♣"]; | ||
| const vailRanks = ["A","2","3","4","5","6","7","8","9","10","J","Q","k"]; | ||
|
|
||
| if (!vaildSuits.includes) || !validRanks.inculdes(rank){ | ||
| throw new Error("Invaild card"); | ||
| } | ||
| if (rank === "A") return 11; | ||
| if (rank === "J" || rank === "Q" || rank === "K") return 10; | ||
|
|
||
| return Number(rank); | ||
| } |
Contributor
There was a problem hiding this comment.
- There is a bug in this code.
Fix typos in test cases and improve assertions for the isProperFraction function.
Fix typos in test cases for isProperFraction function.
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
Changelist
I have completed the Sprint 3 implement and rewrite test
Questions
N/A