-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Ee Hong Zhi] ip #78
base: master
Are you sure you want to change the base?
[Ee Hong Zhi] ip #78
Conversation
implement inheritance for Event, Deadline, Todo classes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside from violating coding guidelines a bit, well done!
src/main/java/Deadline.java
Outdated
@@ -0,0 +1,19 @@ | |||
public class Deadline extends Task{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public class Deadline extends Task{ | |
public class Deadline extends Task { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a space before the curly bracket is more consistent with our coding conventions.
src/main/java/Deadline.java
Outdated
@@ -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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public Deadline(String description, String deadline){ | |
public Deadline(String description, String deadline) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a space before the curly bracket is more consistent with our coding conventions.
src/main/java/Deadline.java
Outdated
} | ||
|
||
@Override | ||
public void show(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public void show(){ | |
public void show() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a space before the curly bracket is more consistent with our coding conventions.
src/main/java/Deadline.java
Outdated
} | ||
else{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | |
else{ | |
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to our coding standards, it is recommended to write the else branch like this.
src/main/java/Deadline.java
Outdated
@Override | ||
public void show(){ | ||
System.out.print("[D]["); | ||
if(isDone){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if(isDone){ | |
if (isDone) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a space before the curly bracket is more consistent with our coding conventions. It is also suggested to add a space after if
.
src/main/java/Duke.java
Outdated
|
||
else if(keyword.equals("unmark")){ | ||
// Check exception: number of words is not 2 | ||
if(words.length != 2){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if(words.length != 2){ | |
if (words.length != 2) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a space before the curly bracket is more consistent with our coding conventions.
src/main/java/Duke.java
Outdated
} | ||
|
||
else if(keyword.equals("unmark")){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | |
else if(keyword.equals("unmark")){ | |
} else if (keyword.equals("unmark")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to our coding standards, it is recommended to write the else branch like this.
src/main/java/Event.java
Outdated
public void show(){ | ||
System.out.print("[D]["); | ||
if(isDone){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a space before the curly bracket is more consistent with our coding conventions.
src/main/java/Duke.java
Outdated
+ "| |_| | |_| | < __/\n" | ||
+ "|____/ \\__,_|_|\\_\\___|\n"; | ||
System.out.println("Hello from\n" + logo); | ||
static private Task[] taskList = new Task[100]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static private Task[] taskList = new Task[100]; | |
static private Task[] tasks = new Task[100]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Plural form should be used on names representing a collection of objects.
src/main/java/Duke.java
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try{ | |
try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a space before the curly bracket is more consistent with our coding conventions.
* branch-level5: no message add package chatbot add custom exceptions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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() {
src/main/java/Deadline.java
Outdated
@@ -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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
src/main/java/Duke.java
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.