Skip to content

add task solution#3321

Open
impo10nt wants to merge 1 commit into
mate-academy:masterfrom
impo10nt:develop
Open

add task solution#3321
impo10nt wants to merge 1 commit into
mate-academy:masterfrom
impo10nt:develop

Conversation

@impo10nt
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Review Summary

Your implementation meets all core requirements. The Triangle, Circle, and Rectangle classes correctly implement the Figure interface with proper shape, color, and getArea() methods. All area calculations use the correct formulas (Heron's formula, Math.PI, and base×height) with proper rounding. The only issue identified is that the Triangle validation error message is misleading—while the validation logic correctly detects when sides cannot form a triangle (longest side >= sum of others), the error text incorrectly states "All sides of the triangle must be positive numbers." This is a non-blocking quality concern since the validation still functions correctly and throws an error for invalid triangles. However, for better user experience, consider updating the message to explicitly explain that the sides cannot form a valid triangle, such as: "Sides {a}, {b}, {c} cannot form a triangle because the longest side must be less than the sum of the other two sides." All other checklist items pass, including proper use of class modifiers and the getInfo function format. Good work on meeting the requirements!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

Comment thread src/figuresClasses.ts
Comment on lines +20 to +22

if (a >= b + c || b >= c + a || c >= a + b) {
throw new Error('All sides of the triangle must be positive numbers.');
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This error message is misleading. This validation checks if the triangle inequality is violated (longest side >= sum of others), but the message says sides must be positive. Per checklist item #3, provide a detailed description. For example: 'Sides {a}, {b}, {c} cannot form a triangle because the longest side must be less than the sum of the other two sides.'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants