Conversation
Yzkkk
reviewed
Feb 4, 2022
| @@ -1,48 +1,35 @@ | |||
| import java.lang.reflect.Array; | |||
| import java.util.*; | |||
There was a problem hiding this comment.
Hi, pls try not to use "import java.util.*". According to the coding standard, imported classes should always be listed explicitly.
Comment on lines
+14
to
+27
| } 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); |
| displayTask(taskArray); | ||
| } | ||
| }while (!stringInput.equals("bye")); | ||
| }while (!userInput.equals("bye")); |
Comment on lines
+93
to
+120
| 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.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.