generated from CodeYourFuture/Module-Template
-
-
Notifications
You must be signed in to change notification settings - Fork 219
London_ITP_Jan|Aung_Ye_Kyaw |Module-Structuring-Testing-Data |Coursework/sprint 3 #329
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
Closed
Closed
Changes from all commits
Commits
Show all changes
59 commits
Select commit
Hold shift + click to select a range
7ce428b
put answer in comment
sarawone 6442b27
getting dir and ext part from filepath
sarawone b31a592
breaking down the expression in step by step
sarawone 8f67390
fixing error
sarawone abbe390
checking error and write the reason of the error.
sarawone 03caef7
interpret and adding answers
sarawone c8d6e99
adding answers
sarawone da12dc5
finding error and explain
sarawone 713cbf9
read and answer the questions
sarawone 2b9bd4e
adding answers
sarawone 73fec8d
adding answer
sarawone b352caf
adding code
sarawone 6a87825
adding answers
sarawone aa2898b
adding answer
sarawone ccd7540
implement getCardValue function
sarawone 9230d74
adding test function
sarawone b7a5527
adding function & jest statement
sarawone 489ba23
restore Sprint1 to original
sarawone e55312c
restore sprint2 to original
sarawone 0f67671
changing to original version
sarawone 9e4d56b
changing to original version
sarawone 11b6519
changing to original version
sarawone 7ea8f44
changing to original version
sarawone b1f54f7
changing to original version
sarawone 91e9e28
changing to original version
sarawone f05fc9a
changing to original version
sarawone d6fea99
changing to original version
sarawone 67f6a60
changing to original version
sarawone d07cfb0
changing to original version
sarawone c784ca5
changing to original version
sarawone da915e1
changing to original version
sarawone 577b9e6
changing to original version
sarawone 67e1651
changing to original version
sarawone 0c3f7af
Merge branch 'coursework/sprint-3' of https://github.com/sarawone/Mod…
sarawone 41fc8bd
changing to original version
sarawone f5a5ee2
changing to original version
sarawone 4893386
removing negative and modify function
sarawone 541ddf2
changing the variable name
sarawone 489ad20
modify the code
sarawone 618ab0b
adding extra test
sarawone 26fd07c
modify the function
sarawone 75240a8
adding the test cases
sarawone aba23f6
testing with other cases
sarawone 81cb2c5
adding throw in function
sarawone a12d680
adding test for throw
sarawone f16df6e
assign local variable by putting let
sarawone ea3e114
modify the function
sarawone b4066a2
changing variable name to ranks
sarawone 648adf7
changing the error message
sarawone da614be
modify function
sarawone 8a90ce6
adding test cases
sarawone 65ad614
modify the function
sarawone a8c26e6
adding test cases and modify
sarawone 9ed5a3e
adding test cases
sarawone 9fba579
test cases added
sarawone 0620564
modify the code
sarawone f00ef51
modify the code
sarawone 42d22c1
modify to return number
sarawone 8bc74aa
change variable name
sarawone 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,17 @@ | ||
function isProperFraction(numerator, denominator) { | ||
if (numerator < denominator) return true; | ||
// add your completed function from key-implement here | ||
} | ||
if (numerator < denominator) | ||
{ | ||
return true; | ||
} | ||
else if (numerator<0 && denominator<0) | ||
{ | ||
return true; | ||
} | ||
else | ||
{ | ||
return false; | ||
} | ||
|
||
} | ||
|
||
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,44 @@ | ||
function getCardValue(card) { | ||
// replace with your code from key-implement | ||
return 11; | ||
|
||
|
||
let cards = card.slice(0,-1); // drop one last letter from string | ||
|
||
const rank1= ["J","Q","K"]; | ||
|
||
if (cards === "A") // if the input is A return 11 | ||
{ | ||
return 11; | ||
} | ||
else if (card == "Ace") // if the input is Ace return 11 | ||
{ | ||
return 11; | ||
} | ||
|
||
else if (cards.length ==1 && rank1.includes(cards) ) // input length is 1 and input is in rank 1 return 10; | ||
{ | ||
return 10; | ||
} | ||
|
||
else if (cards === "10") // if input is 10 return 10; | ||
{ | ||
return 10; | ||
} | ||
|
||
|
||
else if (cards.length ==1 && rank1.includes(cards)=== false) // if input length is 1 & not include in rank1 | ||
{ | ||
value = Number(cards); // convert the input into number and return the value | ||
return value; | ||
} | ||
|
||
else if (cards.length ==2 && cards != "10") // if input length is 2 and not equal to 10 return invalid | ||
{ | ||
return `The card is invalid`; | ||
} | ||
|
||
|
||
|
||
|
||
|
||
} | ||
module.exports = getCardValue; |
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.
Uh oh!
There was an error while loading. Please reload this page.