-
Notifications
You must be signed in to change notification settings - Fork 83
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
[Seth Lee] iP #85
base: master
Are you sure you want to change the base?
[Seth Lee] iP #85
Conversation
src/main/java/Duke.java
Outdated
@@ -1,48 +1,35 @@ | |||
import java.lang.reflect.Array; | |||
import java.util.*; |
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.
Hi, pls try not to use "import java.util.*". According to the coding standard, imported classes should always be listed explicitly.
src/main/java/Duke.java
Outdated
} else if (userInput.equals("list")) { | ||
displayList(taskArray); | ||
} else if (userInput.contains("unmark")) { | ||
unmarkTask(taskArray, userInput); | ||
displayUnmarkedTask(taskArray, userInput); | ||
} else if (userInput.contains("mark")){ | ||
markTask(taskArray, userInput); | ||
displayMarkedTask(taskArray, userInput); | ||
} else if (userInput.contains("deadline")){ | ||
addDeadline(taskArray, userInput); | ||
displayTask(taskArray); | ||
} else if (userInput.contains("event")){ | ||
addEvent(taskArray, userInput); | ||
displayTask(taskArray); |
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.
clean and neat, very organised :)
src/main/java/Duke.java
Outdated
} | ||
}while (!stringInput.equals("bye")); | ||
}while (!userInput.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.
good to have a space before "while"
src/main/java/Duke.java
Outdated
public static void addTodo(ArrayList<Task> taskArray, String userInput){ | ||
String[] temp = new String[100]; | ||
temp = userInput.split(" "); | ||
String description = temp[1]; | ||
Todo todo = new Todo(description); | ||
addTask(taskArray,todo); | ||
} | ||
public static void displayTask(ArrayList<Task> taskArray){ | ||
System.out.println("Gotcha. Here's what you have to do"); | ||
System.out.println(taskArray.get(taskArray.size()-1).toString()); | ||
System.out.println("There are " + taskArray.size() + " tasks in the list"); | ||
} | ||
public static void addDeadline(ArrayList<Task> taskArray, String userInput){ | ||
String[] temp = new String[100]; | ||
temp = userInput.split("/by"); | ||
String description = temp[0].split("deadline")[1].trim(); | ||
String by = temp[1].trim(); | ||
Deadline deadline = new Deadline(description, by); | ||
addTask(taskArray,deadline); | ||
} | ||
public static void addEvent(ArrayList<Task> taskArray, String userInput){ | ||
String[] temp = new String[100]; | ||
temp = userInput.split("/at"); | ||
String description = temp[0].split("event")[1].trim(); | ||
String at = temp[1].trim(); | ||
Event event = new Event(description, at); | ||
addTask(taskArray,event); | ||
} |
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.
nice! naming and structure are very consistent.
This reverts commit 2f75d53.
# Conflicts: # src/main/java/duke/application/Duke.java
Add increment: Level-9
Add increment: A-JavaDoc
No description provided.