-
Notifications
You must be signed in to change notification settings - Fork 118
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
[Guoyi] ip #109
base: master
Are you sure you want to change the base?
[Guoyi] ip #109
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good just some minor suggestions!
|
||
while (true) { | ||
input = scanner.nextLine(); | ||
if (input.equals("bye")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using a long list of else ifs you could consider re factoring this into switch case form to improve readability. Just a suggestion!
|
||
class Task { | ||
protected String description; | ||
protected boolean isDone; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job following the naming conventions for boolean variables!
System.out.println("Now you have " + taskCount + " tasks in the list."); | ||
} else if (input.startsWith("deadline ")) { | ||
String[] parts = input.substring(9).split(" /by "); | ||
tasks[taskCount] = new Deadline(parts[0], parts[1]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could consider adding some edge case catchers here to remind user the correct argument usage.
For example, if the user forgets to put /by you could print out something like expected argument containing /by
} | ||
|
||
class Event extends Task { | ||
protected String from; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job keeping all variables in protected accessibility to improve security of your object's members!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of putting all your code in a single file, consider using separate files instead.
System.out.println("What can I do for you?"); | ||
|
||
Scanner scanner = new Scanner(System.in); | ||
Task[] tasks = new Task[100]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can avoid the use of 100 here which is a magic number.
No description provided.