Skip to content
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

Realized the creation of a generator of geometric shapes with random … #1753

Closed
wants to merge 1 commit into from

Conversation

SIPervii
Copy link

@SIPervii SIPervii commented Dec 1, 2024

Realized the creation of a generator of geometric shapes with random values

Copy link

@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.


Thank you for your hard work on this project! 😊 While your code is generally well-structured and meets many of the task requirements, there are a few critical issues that need to be addressed before we can approve the pull request:

  1. Constructor Error in Rectangle Class: There's a critical mistake in the constructor where this.width is assigned twice, which affects the functionality of the area calculation. This needs to be corrected to this.height = height;.

  2. Variable Naming in RightTriangle Class: The typo in the variable name fistLeg should be corrected to firstLeg to ensure clarity and maintainability.

  3. Accessibility of color Field: Ensure that the color field in the Figure class is accessible in the Circle class. If color is private, consider adding a getter method in Figure.

These issues are important to resolve as they impact the functionality and clarity of your code. Once these are fixed, your code will be in great shape! Keep up the excellent work, and don't hesitate to reach out if you have any questions or need further assistance. 🚀

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

🔄 Fix the issues, commit the changes, and then re-request my review using the Re-request review button in the Reviewers tab.

Comment on lines +18 to +19
System.out.println("Figure: circle, area: " + getArea()
+ " radius: " + radius + " color " + color);

Choose a reason for hiding this comment

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

The color field is accessed directly, assuming it is a protected or public field in the Figure class. If color is private in Figure, you need to provide a getter method in Figure to access it.

Copy link
Author

Choose a reason for hiding this comment

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

🔄 Исправьте проблемы, внесите изменения, а затем повторно запросите мою проверку с помощью Re-request reviewкнопки на вкладке «Рецензенты».
Где эта кнопка?


public class ColorSupplier {
private static final Random random = new Random();
private static final String[] Colors = {"red", "blue", "yellow", "green", "purple", "black"};

Choose a reason for hiding this comment

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

The array Colors should follow the Java naming convention for constants, which is all uppercase letters with words separated by underscores. Consider renaming it to COLORS.

import java.util.Random;

public class FigureSupplier {
private static final Random random2 = new Random();

Choose a reason for hiding this comment

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

The variable random2 should follow a more descriptive naming convention. Consider renaming it to random or randomGenerator for clarity.

public Rectangle(String color, double width, double height) {
super(color);
this.width = width;
this.width = height;

Choose a reason for hiding this comment

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

There is a mistake in the constructor: this.width = height; should be this.height = height;. This error causes the height field to be incorrectly initialized, affecting the area calculation.

package core.basesyntax;

public class RightTriangle extends Figure {
private double fistLeg;

Choose a reason for hiding this comment

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

There is a typo in the variable name fistLeg. It should be firstLeg to accurately describe the first leg of the triangle.

@SIPervii SIPervii closed this Dec 1, 2024
@SIPervii SIPervii deleted the hm-oop-figure branch December 1, 2024 07:37
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.

3 participants