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

Create classes Truck, Bulldozer, and Excavator that will inherit from… #2316

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

Conversation

BoichukMaryna
Copy link

… Machine

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! 😊 There are a few critical issues that need to be addressed before we can approve the pull request. The doWork() and stopWork() methods in the Excavator and Bulldozer classes are currently printing incorrect messages that refer to a 'Truck' instead of their respective machine types. This impacts the functionality as it does not accurately reflect the operations of each class. Please update the messages to correctly indicate the specific machine type. Once these changes are made, your code will be in great shape! 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.

class Bulldozer 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 should refer to 'Bulldozer' instead of 'Truck'. Change the message to 'Bulldozer started working.'


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

The message should refer to 'Bulldozer' instead of 'Truck'. Change the message to 'Bulldozer stopped working.'

class Excavator 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 should refer to 'Excavator' instead of 'Truck'. Change the message to 'Excavator started working.'


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

The message should refer to 'Excavator' instead of 'Truck'. Change the message to 'Excavator stopped working.'

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 updating the Bulldozer and Excavator classes! The doWork() and stopWork() methods now correctly reflect the operations of each class. The Machine class is well-implemented as an abstract class, and the MainApp class effectively demonstrates polymorphism by using an array of Machine objects. The Truck class is also correctly implemented.

Your code meets the task requirements and constraints, and there are no missing or unrelated files.

Keep in mind that while the decision is to APPROVE this Pull Request to help you move forward with your learning, it's important to review the comments and ensure you understand the changes made. This will help you improve your coding skills and avoid similar issues in the future. Keep up the good work and continue learning from your experiences! 🚀

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

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