[janelleenqi] iP#75
Conversation
| System.out.println("Hello! I'm\n" + logo); | ||
| System.out.println("What can I do for you?"); | ||
|
|
||
| Task[] theList = new Task[100]; |
There was a problem hiding this comment.
Consider using a more descriptive name such as taskList instead of theList
|
|
||
| String echo = userInput.nextLine(); | ||
|
|
||
| while (!echo.equals("bye")) { |
There was a problem hiding this comment.
Consider declaring static final constants for each command (e.g. bye, list, mark) so that they can be easily referenced and updated for future use
| while (!echo.equals("bye")) { | |
| private static final String BYE_COMMAND = "bye"; | |
| while (!echo.equals("bye")) { |
| @@ -0,0 +1,27 @@ | |||
| public class Task { | |||
There was a problem hiding this comment.
Good job for using good coding standards in this file! Descriptive names are used for functions and variables
| Scanner userInput = new Scanner(System.in); | ||
| int counter = 0; | ||
|
|
||
| String echo = userInput.nextLine(); |
There was a problem hiding this comment.
Can consider making some changes to the following variables:
echoshould be renamed touserInputStringinstead since your default command is now adding a new taskuserInputshould contain the scanner keyword such asinputScannerto better signify that it is the scanner object
SebasFok
left a comment
There was a problem hiding this comment.
Clear code and good use of white space to make the code clean and easy to read. Good job!
| while (!echo.equals("bye")) { | ||
| String[] words = echo.split(" "); //to identify usage of features "mark" & "unmark" | ||
|
|
||
| if (echo.equals("list")) { |
There was a problem hiding this comment.
Could potentially use a switch if possible to make the code more readable.
|
|
||
| Task[] theList = new Task[100]; | ||
| Scanner userInput = new Scanner(System.in); | ||
| int counter = 0; |
There was a problem hiding this comment.
Perhaps the counter variable could be more descriptive to allow the reader to understand what it is counting.
| } | ||
|
|
||
| //... | ||
| } |
There was a problem hiding this comment.
I like your use of descriptive names to make the code clear and concise.
YongbinWang
left a comment
There was a problem hiding this comment.
Overall good job for your ip so far. Take note of how you name your variables, using clear and appropriate names can improve the readability of your code. Keep up the good work!
| Scanner userInput = new Scanner(System.in); | ||
| int counter = 0; | ||
|
|
||
| String echo = userInput.nextLine(); |
There was a problem hiding this comment.
Consider using a more suitable name for echo so that it is more descriptive for the reader.
| switch (action) { | ||
| case LIST: |
There was a problem hiding this comment.
There is a violation of Java coding standard here. There should be no indentation for case clauses. Please configure your IDE to follow the coding standard.
|
|
||
| case DEADLINE: | ||
| taskDescription = echo.substring(8); | ||
| slashCut = taskDescription.indexOf("/"); |
There was a problem hiding this comment.
Consider renaming this variable to make it more descriptive.
…at ExitCommand can be called
Add JavaDoc Comments
…" are created if they do not exist
pull request 1