Skip to content

[MichelleLiang0116] iP#200

Open
MichelleLiang0116 wants to merge 34 commits into
nus-cs2113-AY2223S2:masterfrom
MichelleLiang0116:master
Open

[MichelleLiang0116] iP#200
MichelleLiang0116 wants to merge 34 commits into
nus-cs2113-AY2223S2:masterfrom
MichelleLiang0116:master

Conversation

@MichelleLiang0116

Copy link
Copy Markdown

No description provided.

@MichelleLiang0116 MichelleLiang0116 changed the title [ MichelleLiang0116] iP [MichelleLiang0116] iP Jan 31, 2023

@skyanzy skyanzy left a comment

Copy link
Copy Markdown

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

Comment thread src/main/java/Duke.java Outdated
Comment on lines +1 to +2
import java.util.ArrayList;
import java.util.Scanner;

Copy link
Copy Markdown

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

Comment thread src/main/java/Duke.java Outdated
while (true) {
Scanner myObj = new Scanner(System.in);
instruction = myObj.nextLine();
if (instruction.equalsIgnoreCase("list")) {

Copy link
Copy Markdown

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

Comment thread src/main/java/Duke.java Outdated
Comment on lines +57 to +59
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);

Copy link
Copy Markdown

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

@Toh-HongFeng Toh-HongFeng left a comment

Copy link
Copy Markdown

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.

Comment thread 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:");

Copy link
Copy Markdown

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.

Comment thread src/main/java/Duke.java Outdated
}
System.out.println(taskList.get(toMark - 1).toString() + '\n' + lineBreak);
} else {
Task t;

Copy link
Copy Markdown

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.

Comment thread src/main/java/Duke.java Outdated
System.out.println(i + 1 + "." + taskList.get(i).toString());
}
System.out.println(lineBreak);
} else if (instruction.equalsIgnoreCase("bye")) {

Copy link
Copy Markdown

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 {

Copy link
Copy Markdown

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.

Comment thread src/main/java/Task.java Outdated
@@ -0,0 +1,26 @@
public class Task {
private final String description;

Copy link
Copy Markdown

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.

Comment thread src/main/java/Duke.java Outdated
private final static ArrayList<Task> taskList = new ArrayList<>();
static String lineBreak = "-----------------";

public static void main(String[] args) {

Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants