-
Notifications
You must be signed in to change notification settings - Fork 73
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
[Melissa Lopez] iP #63
base: master
Are you sure you want to change the base?
Conversation
src/main/java/Duke.java
Outdated
public class Duke { | ||
public static void main(String[] args) { | ||
String lines = "--------------------------------------------"; | ||
String logo = " ____ _ \n" |
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.
Indentation here need to changed into 4 spaces to make indentations consistent in your code
src/main/java/Duke.java
Outdated
|
||
String line; | ||
Task[] tasks = new Task[100]; | ||
int items = 0; |
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.
Maybe numOfItems or itemCount will be a better choice for the variable name here
src/main/java/Duke.java
Outdated
System.out.println((i+1) + ".[" + tasks[i].getStatusIcon() + "] " + tasks[i].description); | ||
} | ||
} else if (line.contains("done")) { | ||
int line_length = line.length(); |
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.
Variable names must be in camelCase so line_length should be lineLength
src/main/java/Duke.java
Outdated
System.out.println(lines); | ||
Task t = new Task(line); | ||
System.out.println("added: " + line); | ||
tasks[items] = t; | ||
items++; |
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.
inconsistent indentations here
src/main/java/Duke.java
Outdated
|
||
|
||
|
||
System.out.println(lines); |
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.
inconsistent indentations here
src/main/java/Task.java
Outdated
} | ||
|
||
public void markAsDone() { | ||
this.isDone = true; |
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.
inconsistent indentations here
src/main/java/Duke.java
Outdated
|
||
|
||
String line; | ||
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.
Maybe you can create a new class called TaskManager which helps you manage tasks and do some operations on tasks. And you can declare the array of Task in this new class. It will make your project more constructured
src/main/java/Duke.java
Outdated
if (line.equals("bye")) { | ||
break; | ||
} else if (line.equals("list")) { | ||
System.out.println(lines); | ||
System.out.println("Here are the tasks in your list: "); | ||
for (int i = 0; i < items; i++) { | ||
System.out.println((i+1) + ".[" + tasks[i].getStatusIcon() + "] " + tasks[i].description); | ||
} | ||
} else if (line.contains("done")) { | ||
int line_length = line.length(); | ||
int number = line.charAt(line_length-1) - '0'; | ||
Task doneTask = tasks[number-1]; | ||
doneTask.markAsDone(); | ||
System.out.println("Nice! I've marked this task as done:"); | ||
System.out.println("[" + doneTask.getStatusIcon() + "] " + doneTask.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.
This part is too big. It will be better if it can be divided into several small methods
Merging A-JavaDoc branch
No description provided.