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

Implement Machine, Truck, Bulldozer, and Excavator classes #2171

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

Conversation

vDmytriv01
Copy link

No description provided.

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 Machine class hierarchy and MainApp class! 👍 The use of abstraction and polymorphism is spot on, and the code meets the core functionality requirements. Just remember for next time to make your log messages more specific to the machine in action – it will make debugging and maintenance a lot easier. Keep up the good work! 🚀

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

public class Bulldozer extends Machine {
@Override
public void doWork() {
System.out.println("Bulldozer started working.");

Choose a reason for hiding this comment

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

The message should indicate what type of Machine is working right now. Consider specifying that it is a Bulldozer to make the message more informative.


@Override
public void stopWork() {
System.out.println("Bulldozer stopped working.");

Choose a reason for hiding this comment

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

Similarly, the stop message should be more informative and indicate that it is a Bulldozer that has stopped working.

public class Excavator extends Machine {
@Override
public void doWork() {
System.out.println("Excavator started working.");

Choose a reason for hiding this comment

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

The message should be more informative and indicate that it is an Excavator that is working. Consider rephrasing it to 'Excavator is working.' to clearly reflect the type of Machine.


@Override
public void stopWork() {
System.out.println("Excavator stopped working.");

Choose a reason for hiding this comment

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

Similarly, the stop message should also be informative. It could be rephrased to 'Excavator has stopped working.' to maintain consistency and clarity.

public class Truck extends Machine {
@Override
public void doWork() {
System.out.println("Truck started working.");

Choose a reason for hiding this comment

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

The message 'Truck started working.' should be more informative. For instance, it could include the type of machine that has started working. Consider revising it to something like 'Truck is now working.' to clearly indicate the type of machine.


@Override
public void stopWork() {
System.out.println("Truck stopped working.");

Choose a reason for hiding this comment

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

Similarly, the message 'Truck stopped working.' should be more informative. You might want to change it to 'Truck has stopped working.' to make it clear which machine has stopped working.

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