[Gabriel Waikin Loh Matienzo] iP#504
Conversation
LUKE
LUKE helps you remember your tasks, events and deadlines for you!
And it is FREE! Features: Managing tasks
Here's the
|
|
|
||
| String response = scanner.nextLine(); | ||
|
|
||
| while (!response.equals("bye")) { |
There was a problem hiding this comment.
I think you should try splitting the logic in this while loop into different files/methods
RachelCheah
left a comment
There was a problem hiding this comment.
The code seems to adhere to the coding standard specified overall!
aakanshanarain
left a comment
There was a problem hiding this comment.
Looks alright! Not many errors regarding the coding standards here!
| + "|____/ \\__,_|_|\\_\\___|\n"; | ||
| System.out.println("Hello from\n" + logo); | ||
|
|
||
| ArrayList<String> list = new ArrayList<String>(); |
There was a problem hiding this comment.
Variable 'list' could be more descriptive; i.e, describe the purpose of the variable
| int taskNo = Integer.parseInt(response.replaceAll("\\D", "")) - 1; | ||
| System.out.println(lineBreak); | ||
| System.out.println("\t Nice! I've marked this task as done:"); | ||
| list.set(taskNo, list.get(taskNo).substring(0,4) + "X" + list.get(taskNo).substring(5)); |
| private static void save(ArrayList<String> tasks) throws IOException { | ||
| File f = new File("tasks.txt"); | ||
| System.out.print(f.createNewFile()); | ||
| FileWriter fw = new FileWriter("tasks.txt"); |
There was a problem hiding this comment.
A longer, more descriptive name (like simply fileWriter) might be better here.
| list.add(amount, "[T][ ] " + response.substring(5)); | ||
| amount++; | ||
| save(list); | ||
| } else if (response.matches("deadline .+")) { |
There was a problem hiding this comment.
For response matching, you might benefit from using Enums :)
| System.out.println("☹ OOPS!!! The description of an event cannot be empty."); | ||
| System.out.println(lineBreak); | ||
| } else { | ||
| System.out.println(lineBreak); |
There was a problem hiding this comment.
You could consider abstracting the
System.out.println(lineBreak);
System.out.println(something);
System.out.println(lineBreak);to avoid repeated code
|
Good code, but you might benefit from splitting your logic into multiple files :) |
Sample data has many blank lines. Blank lines are signs of messy code. Let's delete the blank lines. It is only way to get rid of the blank lines. This is an example for A-FullCommitMessage.
A-Assertions
A-CodeQuality
Add Gradle support
No description provided.