-
Notifications
You must be signed in to change notification settings - Fork 200
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
[MichelleLiang0116] iP #200
base: master
Are you sure you want to change the base?
[MichelleLiang0116] iP #200
Conversation
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.
Good job! you did really well in following java coding standards! well done in making sure that no line exceeds 120 characters
src/main/java/Duke.java
Outdated
import java.util.ArrayList; | ||
import java.util.Scanner; |
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.
good job in importing classes explicitly
src/main/java/Duke.java
Outdated
while (true) { | ||
Scanner myObj = new Scanner(System.in); | ||
instruction = myObj.nextLine(); | ||
if (instruction.equalsIgnoreCase("list")) { |
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.
good job in using string.equalsIgnoreCase when comparing strings
src/main/java/Duke.java
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good job in separating your output string to make your code look neat
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.
Good job on code quality, but can be improved.
src/main/java/Duke.java
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Executing list command can be done on another java file.
src/main/java/Duke.java
Outdated
} | ||
System.out.println(taskList.get(toMark - 1).toString() + '\n' + lineBreak); | ||
} else { | ||
Task t; |
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.
Naming for this variable can be clearer.
src/main/java/Duke.java
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inheritance to split task types is well done.
src/main/java/Task.java
Outdated
@@ -0,0 +1,26 @@ | |||
public class Task { | |||
private final String description; |
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.
Good job restricting access to object variables.
src/main/java/Duke.java
Outdated
public class Duke { | ||
private final static ArrayList<Task> taskList = new ArrayList<>(); | ||
static String lineBreak = "-----------------"; | ||
|
||
public static void main(String[] args) { |
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.
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.