Skip to content

Conversation

@HadiVahidi20
Copy link

@HadiVahidi20 HadiVahidi20 commented Oct 24, 2025

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

All implemented tests are completed.

Questions

@HadiVahidi20 HadiVahidi20 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 24, 2025
@github-actions
Copy link

Your PR's title didn't contain a known region.

Please check the expected title format, and make sure your region is in the correct place and spelled correctly.

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

1 similar comment
@github-actions
Copy link

Your PR's title didn't contain a known region.

Please check the expected title format, and make sure your region is in the correct place and spelled correctly.

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

Copy link
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • The changes (file additions) made in the Sprint-1 and Sprint-2 folder are not related to Sprint-3 exercise. Can you revert the changes made in that two folders?

  • Can you check out this PR Guide and update the PR title and PR description accordingly?

Comment on lines 14 to 25
if(numerator===denominator){
return false
}
if((Math.abs(numerator))<denominator){
return true
}
if (numerator > denominator) {
return false;
}
if (denominator === 0){
return false
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • The statements in the function are evaluated in the order they appear in the code. As soon as the condition on line 11 is evaluated to true, the function would have returned true immediately. However, -3/2 is not a proper fraction.

  • The spec does not specify whether denominator can be negative or not.
    How would you update the function so that it would work equally well when denominator is negative?

  • If you are up the some challenge, try simplify the code to use at most one if-statement.

Comment on lines 24 to 28
// for (let i=1; i<10; i++){
// if (i==5){
// return rank === "5"
// }
// }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why keep this code in a comment?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying to use for loop and forgot to delete it. sorry

Comment on lines 15 to 17
test ("should return true for negative Fraction",()=>{
expect(isProperFraction(-4,7)).toEqual(true);
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test description could be misleading.

-3/2 is not a proper fraction, so isProperFraction(-3,2) should return false.

Comment on lines 11 to 15
test ("should return a 5 for the card with rank of 5 like(5♥) ",()=>{
const fiveofHearts = getCardValue("5♥");
expect(fiveofHearts).toEqual(5);

})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When preparing tests, we should ensure the tests cover all possible cases. If we specify a test for individual rank, we will need about 13 tests to cover all possible cases. Instead, we could consider classifying all possible values into different categories, and then within each category we test some samples.

For example, one possible category for getCardValue() is, "should return the value of number cards (2-10)", and we can prepare the test as

test("should return the value of number cards (2-10)", () => {
    expect(getCardValue("2♣︎")).toEqual(2);
    expect(getCardValue("5♠")).toEqual(5);
    expect(getCardValue("10♥")).toEqual(10);
    // Note: We could also use a loop to check all values from 2 to 10.
});


})
// Case 3: Handle Face Cards (J, Q, K):
test("shoild return 10 fore the faced cart like king(K♦) and queen (Q♣)")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Few words are misspelled
  • Could also include J

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Oct 27, 2025
@github-actions
Copy link

Your PR's title didn't contain a known region.

Please check the expected title format, and make sure your region is in the correct place and spelled correctly.

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

1 similar comment
@github-actions
Copy link

Your PR's title didn't contain a known region.

Please check the expected title format, and make sure your region is in the correct place and spelled correctly.

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

@HadiVahidi20 HadiVahidi20 changed the title wet midland| 25-ITP-septamber| Hadi Vahidi | Sprint3 | Coursework/sprint 3 implement and rewrite Birmingham | 25-ITP-Sep | Hadi-Vahidi | Sprint 3 |sprint-3-implement-and-rewrite Oct 31, 2025
@HadiVahidi20 HadiVahidi20 added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Oct 31, 2025
Copy link
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good. It seems you had a different definition of pure fraction.

}
if (denominator === 0){
return false
if (numerator < denominator && numerator > -denominator) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In math, 2/-3 is equal to -2/3, and -2/-3 = 2/3.
So ideally isProperFraction(2, -3) and isProperFraction(-2, -3) should also true.

Suggestion: Look up the definition of proper fraction.

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Oct 31, 2025
@HadiVahidi20 HadiVahidi20 added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Oct 31, 2025
@cjyuan
Copy link
Contributor

cjyuan commented Nov 1, 2025

Changes look good.

@cjyuan cjyuan added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Nov 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants