Skip to content

[RyanLing] iP#207

Open
RyanLing169 wants to merge 33 commits intonus-cs2113-AY2425S2:masterfrom
RyanLing169:master
Open

[RyanLing] iP#207
RyanLing169 wants to merge 33 commits intonus-cs2113-AY2425S2:masterfrom
RyanLing169:master

Conversation

@RyanLing169
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

@thomasjlalba thomasjlalba left a comment

Choose a reason for hiding this comment

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

I see good effort in keeping up your code standards and quality, good job! Just a few minor suggestions here and there on that aspect.

Comment on lines +67 to +76
} else {
String[] eventPartsFrom = inputParts[1].split("/from");
String[] eventPartsTo = eventPartsFrom[1].split("/to");
taskList[taskCount] = new Event(eventPartsFrom[0].trim(), eventPartsTo[0].trim(), eventPartsTo[1].trim());
System.out.println(INDENT + LINE + "\n" + INDENT + "Got it. I've added this task: ");
taskCount += 1;
System.out.println(INDENT + taskList[taskCount - 1]);
System.out.println(INDENT + "You now have " + taskCount + " tasks in the list."
+ "\n" + INDENT + LINE);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Comment on lines +41 to +45
int taskNum = Integer.parseInt(inputParts[1]);
taskList[taskNum - 1].MarkAsDone();
System.out.println(INDENT + LINE + "\n" + MARKED);
System.out.println(INDENT + taskList[taskNum - 1]);
System.out.println(INDENT + LINE);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Maybe the if/else if/else blocks can be abstracted to its own methods to avoid such a long main method

String input = scanner.nextLine();
String[] inputParts = input.split(" ", 2);

if (input.equals("bye")) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Maybe you can avoid magic literals

String MARKED = INDENT + "Nice! I've marked this task as done:";
String UNMARKED = INDENT + "OK, I've marked this task as not done yet:";

System.out.println(GREETING);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good job on refactoring some of the magic strings!

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