Skip to content

Conversation

@RahwaZeslusHaile
Copy link

Learners, PR Template

Self checklist

  • [ x] I have committed my files one by one, on purpose, and for a reason
  • [ x] I have titled my PR with REGION | COHORT_NAME | FIRST_NAME LAST_NAME | PROJ_NAME
  • [ x] I have tested my changes
  • [ x] My changes follow the style guide
  • [ x] My changes meet the requirements of this task

Changelist

Briefly explain your PR.

Questions

Ask any questions you have for your reviewer.
Thank you for your time in reviewing this work

cjyuan and others added 21 commits May 6, 2025 14:44
…ers with test cases that handle the edge cases
@RahwaZeslusHaile RahwaZeslusHaile added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jun 9, 2025
@CameronDowner
Copy link

Note: if you first change to the main branch before creating a new branch for your coursework coursework/sprint-3 when you create a pull request it will only include the changes for that sprint

This makes it easier to review as it's only the relevant changes 🙂

@CameronDowner CameronDowner added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Jun 14, 2025
@CameronDowner CameronDowner self-assigned this Jun 14, 2025
Copy link

@CameronDowner CameronDowner left a comment

Choose a reason for hiding this comment

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

This is really good - I've asked some more advanced questions as I can see you're doing really well.

I will mark as Complete because this already meets all the criteria, but feel these questions will help you go further 🙂

@@ -10,7 +10,16 @@
function getAngleType(angle) {

Choose a reason for hiding this comment

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

What would you expect to see from this?

getAngleType("45");

Copy link
Author

Choose a reason for hiding this comment

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

I expect an error because "45" is a string not a number.I refactor the code to convert the parameter to number datatype and I use switch(true),just to stretch my self


if(rank === "A") return 11;
if (["J","Q","K"].includes(rank)) return 10;
if(!isNaN(rank) && Number(rank) >= 2 && Number(rank) <= 10 ) return Number(rank);

Choose a reason for hiding this comment

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

Is there a way to simplify this if statement?

e.g. could we extract a common variable, do we need all 3 conditions?

if(angle > 90 && angle < 180) return "Obtuse angle"
if(angle === 180) return "Straight angle"
if(angle > 180 && angle < 360) return "Reflex angle"
if (typeof angle !== 'number' || angle < 0 || angle >= 360) return "Invalid angle";

Choose a reason for hiding this comment

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

Could moving this validation if statement to the top help simplify our function?

Choose a reason for hiding this comment

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

One thing I like to remember: code is read by the computer, but also by other people.

You're getting on great with these courseworks, so I think you should start considering: can I make this code easier to read for other people?


// Case 3: Identify Negative Fractions:
test("should return true for a proper fraction with one of the value negative ", () => {
expect(isProperFraction(-2, 3)).toEqual(true);

Choose a reason for hiding this comment

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

Jest also has .toBeTruthy(): https://jestjs.io/docs/expect#tobetruthy

Why might that not be a good thing to use here?

@CameronDowner CameronDowner added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Jun 14, 2025
@RahwaZeslusHaile
Copy link
Author

@CameronDowner Thank you so much for taking the time to review my code. I truly appreciate your thoughtful feedback — it helped me spot things I had overlooked ,your insights are incredibly valuable to my learning, and I’m grateful for your support and encouragement.

@illicitonion illicitonion deleted the branch CodeYourFuture:to-be-deleted-coursework/sprint-3 July 21, 2025 09:46
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.

4 participants