Skip to content

London | ITP-May-2025 | Seddiq Azam | Module-Structuring-and-Testing-Data | Sprint-3 #621

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
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

sedazam
Copy link

@sedazam sedazam commented Jun 28, 2025

Learners, PR Template

Self checklist

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

Changelist

Briefly explain your PR.

This PR includes updates and changes made across multiple Sprint 3 exercises, which include:

  • 1-get-angle-type.js
    Improved logic clarity and added corresponding test updates.

  • 2-is-proper-fraction.js
    Refined logic to correctly handle negative values and exceptional cases (e.g., -3/-4 as a proper fraction).

  • 3-get-card-value.js
    Enhanced handling for edge cases and improved code readability.

  • Practice Implementations
    Added and updated various files (e.g., count.js, get-ordinal-number.js, repeat.js) to meet assignment requirements and ensure consistent behaviour.


All updated files were tested to ensure correctness and alignment with the task specifications.

Questions

Ask any questions you have for your reviewer.

sedazam added 14 commits June 25, 2025 16:59
modified:   Sprint-3/2-mandatory-rewrite/1-get-angle-type.js
	modified:   Sprint-3/2-mandatory-rewrite/1-get-angle-type.test.js
	modified:   Sprint-3/2-mandatory-rewrite/1-get-angle-type.test.js
	modified:   Sprint-3/2-mandatory-rewrite/2-is-proper-fraction.test.js
	modified:   Sprint-3/2-mandatory-rewrite/3-get-card-value.test.js
	modified:   Sprint-3/3-mandatory-practice/implement/count.test.js
	modified:   Sprint-3/3-mandatory-practice/implement/get-ordinal-number.test.js
	modified:   Sprint-3/3-mandatory-practice/implement/repeat.test.js
@sedazam sedazam added 📅 Sprint 3 Assigned during Sprint 3 of this module Needs Review Participant to add when requesting review labels Jun 28, 2025
	new file:   package-lock.json
	modified:   package.json
Comment on lines 3 to 6
// if (numerator > denominator) return false;
// if (numerator === denominator) return false;
if (denominator === 0) throw new Error("Denominator cannot be zero");
if (numerator * denominator <= 0) return false; // Check for negative fractions or zero
Copy link
Contributor

Choose a reason for hiding this comment

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

In mathematics, -A/B == A/-B == -(A/B), and -A/-B == A/B for any integers A and B (B ≠ 0).
They represent a proper fraction if A < B and A ≠ 0 and B ≠ 0.

-2/3 is considered a proper fraction.

Copy link
Contributor

Choose a reason for hiding this comment

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

You haven't made any change to your code.

isProperFraction(-2, 3) should return true.

Comment on lines 5 to 24
let result;
if (num === 1) {
return "1st";
} else if (num === 2) {
return "2nd";
} else if (num === 3) {
return "3rd";
} else if (num >= 4 && num <= 20) {
return num + "th";
} else if (num % 10 === 1) {
// % gives the last digit of the number
return num + "st";
} else if (num % 10 === 2) {
return num + "nd";
} else if (num % 10 === 3) {
return num + "rd";
}
const s = ["th", "st", "nd", "rd"];
const v = num % 100; // Get the last two digits of the number
result = num + (s[(v - 20) % 10] || s[v] || s[0]); // Determine the correct suffix based on the last two digits
Copy link
Contributor

Choose a reason for hiding this comment

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

  • The ordinal of 111 is "111th".

  • Can you explain how the code at line 24 works?

Copy link
Contributor

@cjyuan cjyuan Jul 7, 2025

Choose a reason for hiding this comment

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

Can you also address this comment and question?

  • The ordinal of 111 is "111th" (Can you check what your function returns when num is 111?)

  • Can you explain how the code at line 24 works?

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review and removed Needs Review Participant to add when requesting review labels Jul 6, 2025
sedazam added 2 commits July 7, 2025 07:04
…angle Sprint-3/2-mandatory-rewrite/1-get-angle-type.js
…te/3-get-card-value.js

	modified: Grouped multi tests  Sprint-3/2-mandatory-rewrite/3-get-card-value.test.js
	modified: Answered questions  Sprint-3/3-mandatory-practice/implement/get-ordinal-number.test.js
@sedazam sedazam added the Needs Review Participant to add when requesting review label Jul 7, 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.

Could you also practice responding to comments directly in the comment threads? It could make tracking the discussion easier.

image

Here is a simplified version of best practices ChatGPT suggested for responding to inline comments in a pull request:

  • ✅ Reply to every comment – Let the reviewer know you saw it.
  • ✏️ Make the change if needed – Fix the code if the comment points out a real issue.
  • 🤔 Explain if you don't agree – If you think the code is fine, politely explain why.
  • ✅ Mark as resolved when done – Only mark comments resolved after you fix or respond.
  • 💬 Keep replies short and polite – Be respectful and to the point.
  • ⏱️ Respond soon – Don’t wait too long to reply.
  • 🧪 Test your changes – Make sure your fixes actually work.
  • 📍 Reply directly under the comment – This keeps the conversation easy to follow.

Comment on lines 5 to 24
let result;
if (num === 1) {
return "1st";
} else if (num === 2) {
return "2nd";
} else if (num === 3) {
return "3rd";
} else if (num >= 4 && num <= 20) {
return num + "th";
} else if (num % 10 === 1) {
// % gives the last digit of the number
return num + "st";
} else if (num % 10 === 2) {
return num + "nd";
} else if (num % 10 === 3) {
return num + "rd";
}
const s = ["th", "st", "nd", "rd"];
const v = num % 100; // Get the last two digits of the number
result = num + (s[(v - 20) % 10] || s[v] || s[0]); // Determine the correct suffix based on the last two digits
Copy link
Contributor

@cjyuan cjyuan Jul 7, 2025

Choose a reason for hiding this comment

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

Can you also address this comment and question?

  • The ordinal of 111 is "111th" (Can you check what your function returns when num is 111?)

  • Can you explain how the code at line 24 works?

@cjyuan cjyuan removed the Needs Review Participant to add when requesting review label Jul 7, 2025
sedazam added 3 commits July 8, 2025 14:40
…2-mandatory-rewrite/2-is-proper-fraction.js

	modified: Sprint-3/2-mandatory-rewrite/2-is-proper-fraction.test.js
@sedazam sedazam added the Needs Review Participant to add when requesting review label Jul 8, 2025
	modified:   Sprint-3/2-mandatory-rewrite/3-get-card-value.test.js
@cjyuan
Copy link
Contributor

cjyuan commented Jul 8, 2025

Changes look good. Well done!

@cjyuan cjyuan added Complete Volunteer to add when work is complete and review comments have been addressed and removed Needs Review Participant to add when requesting review Reviewed Volunteer to add when completing a review labels Jul 8, 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 review comments have been addressed 📅 Sprint 3 Assigned during Sprint 3 of this module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants