Skip to content
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

Open
wants to merge 48 commits into
base: master
Choose a base branch
from
Open

Conversation

ananda-lye
Copy link

No description provided.

String goodbye = "Bye. Hope to see you again soon!";
System.out.println(greeting);

Task[] tasklist = new Task[100];
Copy link

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'

Task[] tasklist = new Task[100];

Scanner scanner = new Scanner(System.in);
int flag = 0;
Copy link

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


Scanner scanner = new Scanner(System.in);
int flag = 0;
int index = 0;
Copy link

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

System.out.print(".[" + tasklist[i-1].getStatusIcon() + "] " + tasklist[i-1].description + "\n");
}
} else if (userinput.startsWith("done")){
String IndexOfItem = userinput.substring(5);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use camelCase "indexOfItem"

}
} else if (userinput.startsWith("done")){
String IndexOfItem = userinput.substring(5);
int ID = Integer.valueOf(IndexOfItem) - 1;
Copy link

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"

}


public String markAsdone () {
Copy link

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

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.

2 participants