[Kuek Yan Ling] iP#248
Conversation
| System.out.println("added: " + input); | ||
| } else { | ||
| for (int i = 1; i <= lst.size(); i++) { | ||
| System.out.println(i + ". " + lst.get(i-1)); |
There was a problem hiding this comment.
Perhaps there should be whitespace on the left and right of the "-" sign? (:
list.get(i - 1);
| @@ -1,10 +1,189 @@ | |||
| import java.util.*; | |||
There was a problem hiding this comment.
Perhaps imported classes should be listed explicitly? (:
| } | ||
|
|
||
|
|
||
| static void level2() { |
There was a problem hiding this comment.
Perhaps the method names could be more descriptive? In verb form? (:
|
|
||
| } | ||
|
|
||
|
|
There was a problem hiding this comment.
Perhaps more javadoc comments for the methods? (:
markuz5116
left a comment
There was a problem hiding this comment.
I personally think that access modifier should be included for all methods so that readers can know whether the method should be accessed from outside the class, can be clearer for the readers.
|
|
||
| protected String deadline; | ||
|
|
||
| public DeadlineTask(String description, String deadlline) { |
There was a problem hiding this comment.
Perhaps there is a typo for a variable name for deadline rather than deadlline.
| @@ -1,10 +1,189 @@ | |||
| import java.util.*; | |||
There was a problem hiding this comment.
importing tasks individually can be clearer.
|
|
||
| public class Duke { | ||
|
|
||
| static void level1() { |
There was a problem hiding this comment.
Perhaps having a method name that briefly describes what it does would be clearer.
| System.out.println("added: " + input); | ||
| } else { | ||
| for (int i = 1; i <= lst.size(); i++) { | ||
| System.out.println(i + ". " + lst.get(i-1)); |
There was a problem hiding this comment.
Not sure if I liked that the - does not have whitespace before and after it.
| } | ||
|
|
||
|
|
||
| static void level3() { |
There was a problem hiding this comment.
I would personally an access modifier for my method to show whether it can be used outside the package or class.
|
|
||
|
|
||
| static void level3() { | ||
| List<Task> lst = new ArrayList<>(); |
There was a problem hiding this comment.
Perhaps instead of lst, using tasks could be clearer to know what the list contains.
|
|
||
| Scanner sc = new Scanner(System.in); | ||
| String input = sc.nextLine(); | ||
| String[] inputArray = input.split(" "); |
There was a problem hiding this comment.
perhaps rather than inputArray, you can have a plural form of the input to show that it has multiple parts.
| } | ||
| } else if (inputArray[0].equals("todo") || inputArray[0].equals("deadline") || inputArray[0].equals("event")) { //adding a task | ||
| Task task = new Task(""); | ||
| String[] inputArr1; |
There was a problem hiding this comment.
perhaps extracting all the code that deals with different types of tasks could make your code clearer.
| @@ -0,0 +1,21 @@ | |||
| public class Task { | |||
| protected String description; | |||
| protected boolean isDone; | |||
There was a problem hiding this comment.
I like the name of this boolean, clearly tells me what it does.
|
|
||
| protected String deadline; | ||
|
|
||
| public DeadlineTask(String description, String deadlline) { |
There was a problem hiding this comment.
Perhaps there can be Javadoc comments to tell readers how this method works.
|
|
||
| public class Duke { | ||
|
|
||
| static void level1() { |
There was a problem hiding this comment.
Perhaps it would be clearer if this method name starts with a verb?
| Scanner sc = new Scanner(System.in); | ||
| String input = sc.nextLine(); | ||
|
|
||
| List<String> lst = new ArrayList<>(); |
There was a problem hiding this comment.
Perhaps the parameter name can be something like commands? lst may sound a bit unclear to readers.
| @@ -0,0 +1,15 @@ | |||
| public class DeadlineTask extends Task { | |||
There was a problem hiding this comment.
Maybe you can consider putting classes into packages.
# Conflicts: # src/main/java/Duke.java # src/main/java/FileManager.java # src/main/java/TaskList.java
…ExitCommand, DoneCommand, TaskdateCommand (Complete A-MoreOOP)
# Conflicts: # src/main/java/duke/Storage.java # src/main/java/duke/task/TaskList.java
…e current task list. (Complete BCD-Extension, C-DetectDuplicates)
Add assertions (Complete A-Assertions)
…h-BCD-Extension # Conflicts: # data/duke.txt
# Conflicts: # data/duke.txt # src/main/java/duke/Duke.java # src/main/java/duke/task/TaskList.java
# Conflicts: # src/main/java/duke/task/TaskList.java
No description provided.