-
Notifications
You must be signed in to change notification settings - Fork 454
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
[Zhang Yubin] ip #471
base: master
Are you sure you want to change the base?
[Zhang Yubin] ip #471
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.
Overall, a really good job!
src/main/java/Deadline.java
Outdated
@@ -0,0 +1,14 @@ | |||
public class Deadline extends Task { | |||
|
|||
protected String by; |
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.
Should this be more specific as to what it refers to?
src/main/java/Duke.java
Outdated
|
||
while(!input.equals("bye")) { | ||
String[] parts = input.split(" "); | ||
if(input.equals("list")) { |
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.
Might be cleaner to change to switch statements
src/main/java/Event.java
Outdated
@@ -0,0 +1,14 @@ | |||
public class Event extends Task { | |||
|
|||
protected String at; |
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.
Might be good to use a more desceiptive name for the variable
src/main/java/Task.java
Outdated
} | ||
|
||
public String getStatusIcon() { | ||
return (isDone ? "X" : " "); // mark done task with X |
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.
Ternary operators might look cleaner when seperated into multiple lines, and there is no need for the brackets.
src/main/java/Duke.java
Outdated
task.add(event); | ||
System.out.println("Now you have " + task.size() + " tasks in your list"); | ||
System.out.println(line); | ||
} else if (parts[0].equals("todo")){ |
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.
I think there should be a space between ")" and "{", so ) {
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.
Overall pretty good, but it seems like you have not done week 2's task. If you have done so, you should commit it so we can help you review your code.
src/main/java/Duke.java
Outdated
int index = Integer.valueOf(parts[1]); | ||
Task thisTask = task.get(index - 1); | ||
thisTask.markDone(); | ||
System.out.println(line); | ||
System.out.println("Nice! I've marked this task as done:\n" + thisTask.toString()); | ||
System.out.println(line); |
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.
Maybe for this portion can create an additional class(Example UI) to do all this line of code for you, and just need to call that function from the class so that it looks much neater. Can also be done so on your other if-else statements
# Conflicts: # src/main/java/duke/command/Parser.java
Use Assertions feature (not JUnit assertions) to document important assumptions that should hold at various points in the code. Add two assert lines, one is in Parser, to ensure that Parser will always parse userInput correctly, and another is on Command, to make sure the message input can be executed. We do so because it can satisfy our need for safe work in Duke.
DukePro
DukePro frees your mind of having to remember things you need to do. It's,
All you need to do is,
And it is FREE!
Features:
If you Java programmer, you can use it to practice Java too. Here's the main method: