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

Created ENUM, Ball, Color, Lottery classes. Implemented methods in th… #1704

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Jacalius
Copy link

…em according to the given task. Tested the program using the Main class.

…em according to the given task. Tested the program using the Main class.
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 mostly well-implemented, there are a couple of minor issues that need to be addressed before we can approve the pull request. Specifically, there are typographical errors: one in the Ball class's toString method where "colore" should be "color", and another in the Color enum where "YELLOU" should be "YELLOW". Once these are corrected, your code will be ready to go! Keep up the great work! 😊

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


@Override
public String toString() {
return "Return Ball with number:" + number + " and " + color + " colore";

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 toString method. The word 'colore' should be corrected to 'color'.

BLACK,
WHITE,
GREEN,
YELLOU,

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 color name 'YELLOU'. It should be corrected to 'YELLOW'.

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.

Great job on implementing the solution! 🎉 Your code meets the task requirements and constraints, and you've addressed most of the previous issues. Here are a few suggestions to further enhance your code:

  • Magic Number: In Application.java, consider replacing the magic number 3 with a constant, such as private static final int NUMBER_OF_BALLS = 3;. This will improve the readability and maintainability of your code.

  • Typographical Consistency: In Ball.java, the toString method could be more consistent with typical string representations. Consider changing "Return Ball with number:" to "Ball with number: ".

These are minor improvements, but addressing them will help you write cleaner and more maintainable code. Keep up the great work, and continue learning from each iteration! 🚀

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

// create three balls using class Lottery and print information about them in console
Lottery lottery = new Lottery();

for (int i = 0; i < 3; i++) {

Choose a reason for hiding this comment

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

Consider replacing the magic number 3 with a constant. This will improve the readability and maintainability of your code. For example, you could define a constant private static final int NUMBER_OF_BALLS = 3; and use it in the loop condition.


@Override
public String toString() {
return "Return Ball with number:" + number + " and " + color + " color";

Choose a reason for hiding this comment

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

Typographical error: The string in the toString method should be more consistent with typical string representations. Consider changing "Return Ball with number:" to "Ball with number: ".

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