generated from CodeYourFuture/Module-Template
-
-
Notifications
You must be signed in to change notification settings - Fork 195
WM | May-2025 | Abdullah Saleh | Sprint-3 #627
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
3bdullah-saleh
wants to merge
25
commits into
CodeYourFuture:main
Choose a base branch
from
3bdullah-saleh:coursework/sprint-3
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
47b1a74
Implement the function and add test cases
3bdullah-saleh c9e25de
adding semicolon to the missing parts
3bdullah-saleh ff1cbee
Implement a function to check for proper fractions and add test cases
3bdullah-saleh bd578be
Returns the numeric value of a playing card
3bdullah-saleh 9ff46f5
Implement the function and adding test cases
3bdullah-saleh a73f361
Implement the function and adding test cases
3bdullah-saleh 06e2a86
Implement the function and adding test cases
3bdullah-saleh a6f7736
adding invalid card test case
3bdullah-saleh 5753049
Update the function to handel the test cases
3bdullah-saleh df3199e
Implement function to handle ordinal number and added test cases.
3bdullah-saleh a6058f7
Implement 'repeat' function and adding test cases.
3bdullah-saleh b932013
create a JavaScript file
3bdullah-saleh de840d7
create test file for card-validator file
3bdullah-saleh 10e1c6f
Play computer with 'find' function and answering the questions
3bdullah-saleh f24f108
create a function to validate the length of card number and the numbe…
3bdullah-saleh 8305998
Implement a function to create a 16 digit number. Add test cases to …
3bdullah-saleh aa39192
Delete console.log function
3bdullah-saleh 92f2da6
Fixed the return value to 'Obtuse angle' for consistency with the oth…
3bdullah-saleh f603a66
Handle zero denominator with error, return boolean for proper fraction.
3bdullah-saleh b7a90c5
Add test case for "10" card to ensure correct handling in getCardValue.
3bdullah-saleh 134b91c
Simplify isProperFraction function and add/fix related test cases.
3bdullah-saleh 4e1421a
Refactor repeat function formatting for clarity
3bdullah-saleh 0245190
Simplify digit validation by returning early on first non-numeric cha…
3bdullah-saleh 783be9e
Fix indentation of the code.
3bdullah-saleh 87e59b4
Add positive test case to ensure valid card numbers are accepted.
3bdullah-saleh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
function isProperFraction(numerator, denominator) { | ||
if (numerator < denominator) return true; | ||
// add your completed function from key-implement here | ||
return Math.abs(numerator) < Math.abs(denominator) | ||
} | ||
|
||
module.exports = isProperFraction; |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
function getCardValue(card) { | ||
// replace with your code from key-implement | ||
return 11; | ||
let rank = card.slice(0, -1); | ||
if (rank === "A" || rank === "Ace") return 11; | ||
else if (rank >= 2 && rank <= 9) return Number(rank); | ||
else if (rank === 10 || rank === "J" || rank === "Q" || rank === "K") return 10; | ||
else return "Invalid card rank." | ||
} | ||
module.exports = getCardValue; |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,17 @@ | ||
function countChar(stringOfCharacters, findCharacter) { | ||
return 5 | ||
let charNum = stringOfCharacters.split(findCharacter).length -1; | ||
return charNum | ||
|
||
} | ||
|
||
module.exports = countChar; | ||
|
||
module.exports = countChar; | ||
|
||
|
||
/* pseudocode: | ||
// we need to look for a specific character inside a string | ||
|
||
|
||
|
||
|
||
*/ |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
function getOrdinalNumber(num) { | ||
return "1st"; | ||
let oneDigit = num % 10; | ||
let twoDigit = num % 100; | ||
if (twoDigit >= 11 && twoDigit <= 13 ) return `${num}th`; | ||
else if (oneDigit == 1) return `${num}st`; | ||
else if (oneDigit == 2) return `${num}nd`; | ||
else if (oneDigit == 3) return `${num}rd`; | ||
else return `${num}th`; | ||
} | ||
|
||
module.exports = getOrdinalNumber; |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
function repeat() { | ||
return "hellohellohello"; | ||
function repeat(str, count) { | ||
if (count > 0) return `${str.repeat(count)}`; | ||
else if (count == 0) return ""; | ||
else if (count < 0) return "negative counts are not valid"; | ||
} | ||
|
||
module.exports = repeat; | ||
module.exports = repeat; |
Oops, something went wrong.
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.
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.
Good identification of an edge-case here - most people doing this exercise notice 12 but forget about 112!
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.
Thanks! That feedback means a lot