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

[Chua Zhong Heng] iP #63

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

Conversation

Cazh1
Copy link

@Cazh1 Cazh1 commented Sep 4, 2023

No description provided.

Copy link

@karishma-t karishma-t left a comment

Choose a reason for hiding this comment

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

lgtm! good use of encapsulation

public static void printLine() {
System.out.println(" ____________________________________________________________");
}

Choose a reason for hiding this comment

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

Can consider adding javadoc comments for each method for greater clarity.

add(itemList, markList, item);
}
dialogue(itemList, markList);
}

Choose a reason for hiding this comment

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

Good use of naming standards, e.g camelCase

}
printLine();
}

Choose a reason for hiding this comment

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

Good layout structure

int listIndex = Integer.parseInt(splitItem[1]);
unmark(itemList, markList, listIndex);
} else {
add(itemList, markList, item);

Choose a reason for hiding this comment

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

indentations just require one more space

Copy link

@ShaniceTang ShaniceTang left a comment

Choose a reason for hiding this comment

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

Overall, your coding quality is very well done and your code is readable! Great job! 💯

printLine();
System.out.println(item);
printLine();
echo();

Choose a reason for hiding this comment

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

Nice!
I like that you use recursion :)

int listIndex = Integer.parseInt(splitItem[1]);
mark(itemList, markList, listIndex);
} else if (item.length() > 6 && item.substring(0, 6).equals("unmark")) {
String[] splitItem = item.split(" ");

Choose a reason for hiding this comment

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

Could this array be named "items" instead?

printLine();
}

public static void main(String[] args) {

Choose a reason for hiding this comment

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

I like that your main method is short and neat :D

public static void dialogue(ArrayList<String> itemList, ArrayList<String> markList) {
Scanner input = new Scanner(System.in);
String item = input.nextLine();
if (item.equals("bye")) {

Choose a reason for hiding this comment

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

I like that you use else-if instead of nesting 👍

Copy link

@woowenjun99 woowenjun99 left a comment

Choose a reason for hiding this comment

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

Good job on your first milestone! Not to bad, just that perhaps you might want to consider replacing all the magic number and magic string with variables and not sure if I am correct, there is a recursive call.

@@ -0,0 +1,15 @@
public class Event extends Task{

Choose a reason for hiding this comment

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

Perhaps you want to add an additional space in front of the curly paranthesis?

printLine();
System.out.println(" Here are the tasks in your list:");
for (int i = 0; i < taskList.size(); i++) {
System.out.printf(" %d.%s\n", i+1, taskList.get(i));

Choose a reason for hiding this comment

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

Nice to use printf!


public static void printGreetingMessage() {
printLine();
System.out.println(" Hello! I'm KenergeticBot\n" + " What can I do for you?");

Choose a reason for hiding this comment

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

Perhaps you would like to replace all the magic strings and numbers in your code with variables for greater readability?

System.out.println(KenergeticBotException.INVALID_COMMAND); // unable to print sad face ˙◠˙
}
}
botDialogue(taskList);

Choose a reason for hiding this comment

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

Is this recursion???

Comment on lines 4 to 5


Choose a reason for hiding this comment

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

Perhaps you would like to remove these extra spaces?

Comment on lines 4 to 5
protected String taskType;
protected int taskIndex;

Choose a reason for hiding this comment

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

Perhaps you would like to remove this unused variable?

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.

4 participants