[Aiman Imtiaz] iP#74
Conversation
| System.out.println(message); | ||
| } | ||
|
|
||
| public static void unMarkTask(int index){ |
There was a problem hiding this comment.
I think unmark is a word and a verb so you might want to change the name to unmarkedTask
| static int currentCount = 0; | ||
| static String dashedLine = "\t____________________________________________________________"; | ||
|
|
||
| public static void markTask(int index){ |
There was a problem hiding this comment.
to be more grammatically correct you may change the name of the method to markedTask
| static Task[] taskList = new Task[100]; | ||
| static Boolean[] taskStatusList = new Boolean [100]; | ||
| static int currentCount = 0; | ||
| static String dashedLine = "\t____________________________________________________________"; |
There was a problem hiding this comment.
I think constants should be named using all cap and there should be a final before to mark as constant.
| } else if(line.startsWith("unmark")){ | ||
| int indexToUnmark = Integer.parseInt(line.substring(7)); | ||
| unMarkTask(indexToUnmark); | ||
| } else addToList(line); |
There was a problem hiding this comment.
For if else even though it is just a line it is still better to put the content to a separate line and have curly brackets wrapped around it.
|
|
||
| line = in.nextLine(); | ||
|
|
||
| while (!line.contains("bye")){ |
There was a problem hiding this comment.
I like how the main code to run here are very simple to read and I can really tell it is the main code.
| static int currentCount = 0; | ||
| static String dashedLine = "\t____________________________________________________________"; | ||
|
|
||
| public static void markTask(int index){ |
There was a problem hiding this comment.
You could add spaces between the methods and the braces to be more consistent with the K&R style
| while (!line.contains("bye")){ | ||
| if (line.equals("list")){ | ||
| printList(); | ||
| } else if (line.startsWith("mark")){ | ||
| int indexToMark = Integer.parseInt(line.substring(5)); | ||
| markTask(indexToMark); | ||
| } else if(line.startsWith("unmark")){ | ||
| int indexToUnmark = Integer.parseInt(line.substring(7)); | ||
| unMarkTask(indexToUnmark); | ||
| } else addToList(line); | ||
| line = in.nextLine(); | ||
| } |
There was a problem hiding this comment.
Perhaps we can use a switch-case instead?
| static Task[] taskList = new Task[100]; | ||
| static Boolean[] taskStatusList = new Boolean [100]; |
There was a problem hiding this comment.
We can put the magic numbers as a constant instead
|
|
||
| public static void printList(){ | ||
| System.out.print(dashedLine); | ||
| for (int j = 0; j < currentCount; j++){ |
There was a problem hiding this comment.
I feel that the first loop counter should be i instead of j
# Conflicts: # src/main/java/duke/Duke.java
# Conflicts: # src/main/java/duke/Duke.java # src/main/java/duke/FileAccess.java # src/main/java/duke/Runner.java # src/main/java/duke/UI.java
Branch level 9
No description provided.