-
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
Ananda Lye iP #65
base: master
Are you sure you want to change the base?
Ananda Lye iP #65
Conversation
src/main/java/Duke.java
Outdated
String goodbye = "Bye. Hope to see you again soon!"; | ||
System.out.println(greeting); | ||
|
||
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.
try to avoid using 'magic numbers'
src/main/java/Duke.java
Outdated
Task[] tasklist = new Task[100]; | ||
|
||
Scanner scanner = new Scanner(System.in); | ||
int flag = 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.
variable names can be more descriptive to facilitate understanding.
use boolean type instead of int type, phrase like a question eg. isExit
src/main/java/Duke.java
Outdated
|
||
Scanner scanner = new Scanner(System.in); | ||
int flag = 0; | ||
int index = 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.
variable names can be more descriptive to facilitate understanding
src/main/java/Duke.java
Outdated
System.out.print(".[" + tasklist[i-1].getStatusIcon() + "] " + tasklist[i-1].description + "\n"); | ||
} | ||
} else if (userinput.startsWith("done")){ | ||
String IndexOfItem = userinput.substring(5); |
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.
use camelCase "indexOfItem"
src/main/java/Duke.java
Outdated
} | ||
} else if (userinput.startsWith("done")){ | ||
String IndexOfItem = userinput.substring(5); | ||
int ID = Integer.valueOf(IndexOfItem) - 1; |
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.
use descriptive names to differentiate between int type and String type variable
eg. "indexString" & "indexInt"
src/main/java/Task.java
Outdated
} | ||
|
||
|
||
public String markAsdone () { |
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.
use camelCase i.e. markAsDone
…g exception handling
No description provided.