[lckjosh] iP#74
Conversation
| switch (command) { | ||
| case "list": | ||
| if (noOfTasks == 0) { | ||
| System.out.println("____________________________________________________________"); |
There was a problem hiding this comment.
Consider using a constant / final variable to represent the line divider
| int taskToMark = Integer.parseInt(parameters) - 1; | ||
| tasks[taskToMark].markAsDone(); | ||
| System.out.println("____________________________________________________________"); | ||
| System.out.println("I've marked this task as done:"); | ||
| System.out.println(tasks[taskToMark].getStatusIcon() + " " + tasks[taskToMark].getDescription()); | ||
| System.out.println("____________________________________________________________"); |
There was a problem hiding this comment.
Consider moving code in cases to another function to reduce verbosity
| String parameters = ""; | ||
| Task[] tasks = new Task[100]; | ||
| int noOfTasks = 0; | ||
| while (true) { |
There was a problem hiding this comment.
May cause an unintended program behaviour, consider setting the loop conditional to while the command is not bye
| System.out.println("____________________________________________________________"); | ||
| System.out.println("Goodbye, hope to see you again soon!"); | ||
| System.out.println("____________________________________________________________"); | ||
| in.close(); |
There was a problem hiding this comment.
Shift this to outside the loop and the condition becomes the loop condition
irving11119
left a comment
There was a problem hiding this comment.
Your code overall follows the coding standards and naming conventions. The only suggestion I have would to leave blank lines at certain points to separate out logic and make your code more readable.
| printUnderscores(); | ||
| System.out.println("Hello from BotBuddy!"); | ||
| System.out.println("What can I do for you?"); | ||
| printUnderscores(); | ||
| Task[] tasks = new Task[100]; | ||
| String input; | ||
| String[] inputArr; | ||
| String command = ""; | ||
| String parameters = ""; | ||
| Scanner in = new Scanner(System.in); |
There was a problem hiding this comment.
Perhaps you could leave a blank line between certain lines to seperate related logic (e.g. a blank line after your print statements)
| package BotBuddy; | ||
|
|
||
| public class BotBuddyException extends Exception { | ||
| public BotBuddyException(String s) { |
There was a problem hiding this comment.
Perhaps you could use a more descriptive variable than s such as inputString
add ability to find tasks
edit javadoc
edit javadocs
No description provided.