[Ee Hong Zhi] ip#78
Conversation
implement inheritance for Event, Deadline, Todo classes
skylee03
left a comment
There was a problem hiding this comment.
Aside from violating coding guidelines a bit, well done!
| @@ -0,0 +1,19 @@ | |||
| public class Deadline extends Task{ | |||
There was a problem hiding this comment.
| public class Deadline extends Task{ | |
| public class Deadline extends Task { |
There was a problem hiding this comment.
Adding a space before the curly bracket is more consistent with our coding conventions.
| @@ -0,0 +1,19 @@ | |||
| public class Deadline extends Task{ | |||
| private String deadline; | |||
| public Deadline(String description, String deadline){ | |||
There was a problem hiding this comment.
| public Deadline(String description, String deadline){ | |
| public Deadline(String description, String deadline) { |
There was a problem hiding this comment.
Adding a space before the curly bracket is more consistent with our coding conventions.
| } | ||
|
|
||
| @Override | ||
| public void show(){ |
There was a problem hiding this comment.
| public void show(){ | |
| public void show() { |
There was a problem hiding this comment.
Adding a space before the curly bracket is more consistent with our coding conventions.
| } | ||
| else{ |
There was a problem hiding this comment.
| } | |
| else{ | |
| } else { |
There was a problem hiding this comment.
According to our coding standards, it is recommended to write the else branch like this.
| @Override | ||
| public void show(){ | ||
| System.out.print("[D]["); | ||
| if(isDone){ |
There was a problem hiding this comment.
| if(isDone){ | |
| if (isDone) { |
There was a problem hiding this comment.
Adding a space before the curly bracket is more consistent with our coding conventions. It is also suggested to add a space after if.
|
|
||
| else if(keyword.equals("unmark")){ | ||
| // Check exception: number of words is not 2 | ||
| if(words.length != 2){ |
There was a problem hiding this comment.
| if(words.length != 2){ | |
| if (words.length != 2) { |
There was a problem hiding this comment.
Adding a space before the curly bracket is more consistent with our coding conventions.
| } | ||
|
|
||
| else if(keyword.equals("unmark")){ |
There was a problem hiding this comment.
| } | |
| else if(keyword.equals("unmark")){ | |
| } else if (keyword.equals("unmark")) { |
There was a problem hiding this comment.
According to our coding standards, it is recommended to write the else branch like this.
| public void show(){ | ||
| System.out.print("[D]["); | ||
| if(isDone){ |
There was a problem hiding this comment.
| public void show(){ | |
| System.out.print("[D]["); | |
| if(isDone){ | |
| public void show() { | |
| System.out.print("[D]["); | |
| if (isDone) { |
There was a problem hiding this comment.
Adding a space before the curly bracket is more consistent with our coding conventions.
| + "| |_| | |_| | < __/\n" | ||
| + "|____/ \\__,_|_|\\_\\___|\n"; | ||
| System.out.println("Hello from\n" + logo); | ||
| static private Task[] taskList = new Task[100]; |
There was a problem hiding this comment.
| static private Task[] taskList = new Task[100]; | |
| static private Task[] tasks = new Task[100]; |
There was a problem hiding this comment.
Plural form should be used on names representing a collection of objects.
| System.out.println("Please enter with correct format: mark [Integer]"); | ||
| } | ||
| // Check exception: second word cannot be converted to integer or integer out of bounds | ||
| try{ |
There was a problem hiding this comment.
Adding a space before the curly bracket is more consistent with our coding conventions.
* branch-level5: no message add package chatbot add custom exceptions
irving11119
left a comment
There was a problem hiding this comment.
Generally, your naming conventions are fine and adhere to the coding standards. However, do remember when using braces followed by parenthesis to leave a space in between for proper formatting.
e.g. public void method() {
| @@ -0,0 +1,19 @@ | |||
| public class Deadline extends Task{ | |||
| private String deadline; | |||
| public Deadline(String description, String deadline){ | |||
There was a problem hiding this comment.
| public Deadline(String description, String deadline){ | |
| public Deadline(String description, String deadline) { |
Similar to most of your methods, do remember to leave a space between the closing parenthesis and the opening curly brace.
| try{ | ||
| int markIndex = Integer.parseInt(words[1]); | ||
|
|
||
| if(markIndex < 1 || markIndex > numTasks){ | ||
| System.out.println("Please enter a positive integer less than or equal to current number of tasks (" + numTasks + ")"); | ||
| continue; | ||
| } | ||
|
|
||
| taskList[markIndex - 1].mark(); | ||
| } | ||
| catch(NumberFormatException e){ | ||
| System.out.println("Please enter with correct format: mark [Integer]"); | ||
| } |
There was a problem hiding this comment.
Try to avoid deep nesting. Instead of deep nesting, you could break down your statements into additional methods.
* branch-Level-6: change storage format of tasks to ArrayList, add delete functionality
No description provided.