[MichelleLiang0116] iP#200
Conversation
skyanzy
left a comment
There was a problem hiding this comment.
Good job! you did really well in following java coding standards! well done in making sure that no line exceeds 120 characters
| import java.util.ArrayList; | ||
| import java.util.Scanner; |
There was a problem hiding this comment.
good job in importing classes explicitly
| while (true) { | ||
| Scanner myObj = new Scanner(System.in); | ||
| instruction = myObj.nextLine(); | ||
| if (instruction.equalsIgnoreCase("list")) { |
There was a problem hiding this comment.
good job in using string.equalsIgnoreCase when comparing strings
| System.out.println(lineBreak + '\n' + "Got it. I've added this task:"); | ||
| System.out.println('\t' + t.toString()); | ||
| System.out.println("Now you have " + taskList.size() + " tasks in the list." + '\n' + lineBreak); |
There was a problem hiding this comment.
good job in separating your output string to make your code look neat
Toh-HongFeng
left a comment
There was a problem hiding this comment.
Good job on code quality, but can be improved.
| instruction = myObj.nextLine(); | ||
| if (instruction.equalsIgnoreCase("list")) { | ||
| System.out.println(lineBreak + '\n' | ||
| + "Here are the tasks in your list:"); |
There was a problem hiding this comment.
Executing list command can be done on another java file.
| } | ||
| System.out.println(taskList.get(toMark - 1).toString() + '\n' + lineBreak); | ||
| } else { | ||
| Task t; |
There was a problem hiding this comment.
Naming for this variable can be clearer.
| System.out.println(i + 1 + "." + taskList.get(i).toString()); | ||
| } | ||
| System.out.println(lineBreak); | ||
| } else if (instruction.equalsIgnoreCase("bye")) { |
There was a problem hiding this comment.
Can add comments between each command's execution to improve readability.
| @@ -0,0 +1,13 @@ | |||
| public class Deadline extends Task { | |||
There was a problem hiding this comment.
Inheritance to split task types is well done.
| @@ -0,0 +1,26 @@ | |||
| public class Task { | |||
| private final String description; | |||
There was a problem hiding this comment.
Good job restricting access to object variables.
| private final static ArrayList<Task> taskList = new ArrayList<>(); | ||
| static String lineBreak = "-----------------"; | ||
|
|
||
| public static void main(String[] args) { |
There was a problem hiding this comment.
Your main method feels a bit long, can consider modularizing it. According to the textbook, the recommendation is to have 30 LOC.
No description provided.