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

solved task #2173

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

solved task #2173

wants to merge 3 commits into from

Conversation

YuriiBob
Copy link

@YuriiBob YuriiBob commented Oct 7, 2024

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.

Hey there! It looks like you've made some good progress with your code, but there are a few important tweaks we need to address to make it just right. 🛠️ The messages for starting and stopping work in your Machine implementations need to be a bit more descriptive. It's important that they clearly communicate what type of machine is in action and what it's doing. Also, let's tidy up any unused variables to keep your code looking sharp and clean. With these changes, your code will be in top shape! Keep up the good work, and I'm looking forward to seeing your next iteration. 👍

✨ 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 work");

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 Truck, Bulldozer or Excavator. Consider rephrasing to include the type of the machine, for example: 'Bulldozer is doing its work.'


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

Choose a reason for hiding this comment

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

Similar to the doWork method, the message in stopWork should also be more informative and indicate the type of machine. For instance: 'Bulldozer has stopped working.'

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

Choose a reason for hiding this comment

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

The message 'Excavator started work' could be more informative. According to the checklist, the message should indicate what type of Machine is working right now. Consider providing more details about the work the Excavator is doing.


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

Choose a reason for hiding this comment

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

Similarly, the message 'Excavator stopped work' could be more informative. It should describe the state of the Excavator when it stops working, perhaps indicating that it is shutting down or that it has completed its tasks.

@@ -1,5 +1,16 @@
package core.basesyntax;

public class MainApp {

public static void main(String[] args) {
String[] mashine = new String[] {"Truck", "Bulldozer", "Excavator"};

Choose a reason for hiding this comment

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

The variable name mashine contains a typo and is not used in the code. If it's not needed, it should be removed to keep the code clean.

Comment on lines +6 to +8
Machine truck = new Truck();
Machine bulldozer = new Bulldozer();
Machine excavator = new Excavator();

Choose a reason for hiding this comment

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

Good job using abstract references for Machine types. This allows for polymorphism in the code.

Comment on lines +9 to +14
truck.doWork();
bulldozer.doWork();
excavator.doWork();
truck.stopWork();
bulldozer.stopWork();
excavator.stopWork();

Choose a reason for hiding this comment

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

Make sure that the messages in the doWork() and stopWork() methods are informative and indicate what type of Machine is working or stopping work.

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

Choose a reason for hiding this comment

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

The message 'Truck started work' could be more informative. It should indicate what type of Machine is working. Consider including the specific action the Truck is performing.


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

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 work' should be more informative and reflect the specific action the Truck has ceased performing.

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 Excavator class and ensuring that it adheres to the Machine abstract class methods! 🎉 Remember to make the messages in the doWork and stopWork methods more informative to provide clarity on what each machine is doing. 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 is doing its work.");

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 the type of Machine that is working. Consider specifying that a Bulldozer is operating.


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

Choose a reason for hiding this comment

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

Similarly to the doWork method, the message in stopWork should be more informative. Specify that a Bulldozer has stopped working.

public class Excavator extends Machine {
@Override
public void doWork() {
System.out.println("Excavator is doing its work.");

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. For example: 'Excavator started its engine and is digging.'


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

Choose a reason for hiding this comment

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

The stop message should also be more informative. Consider something like: 'Excavator has been turned off and can no longer dig.'

@@ -1,5 +1,16 @@
package core.basesyntax;

public class MainApp {

public static void main(String[] args) {
String[] mashine = new String[] {"Truck", "Bulldozer", "Excavator"};

Choose a reason for hiding this comment

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

The array mashine is declared but never used in the code. If this array is not needed, it should be removed to keep the code clean and avoid unnecessary declarations.

public class Truck extends Machine {
@Override
public void doWork() {
System.out.println("Truck is doing its work.");

Choose a reason for hiding this comment

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

The message 'Truck is doing its work.' is not very informative. It would be better to specify what kind of work the Truck is doing, to make the message more informative as per the checklist.


@Override
public void stopWork() {
System.out.println("Truck has 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 has stopped working.' could be more descriptive. Consider specifying what indicates that the Truck has stopped its work.

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