ParthGandhiNUS iP#174
Conversation
| public class Kowalski { | ||
| public static void main(String[] args){ | ||
| Task[] currentTasks = new Task[100]; | ||
| String dividingLine = "____________________________________________________________"; |
There was a problem hiding this comment.
dividingLine is a constant variable, and I think the variable name should be in capital letters.
| + currentTasks[taskNumber-1].description); | ||
| System.out.println(dividingLine); | ||
| } else { | ||
| break; |
There was a problem hiding this comment.
I think the repeated nested loops can be avoided by including the checking for a valid task number in another function.
| Task[] currentTasks = new Task[100]; | ||
| String dividingLine = "____________________________________________________________"; | ||
| String userInput; | ||
| int counter = 0; |
There was a problem hiding this comment.
I think 'counter' can be replaced with 'taskCounter', so the name explains the variable meaning.
| Scanner in = new Scanner(System.in); | ||
|
|
||
| //Continuous loop until break statement | ||
| while (true){ |
There was a problem hiding this comment.
While loop is a bit long, but readable and easily understood.
sevenseasofbri
left a comment
There was a problem hiding this comment.
Coding standards generally adhered to. Good job! 👍🏽
|
|
||
| private static final String DIVIDING_LINE = "____________________________________________________________"; | ||
|
|
||
| public static List <Task> currentTask = new ArrayList<>(); |
There was a problem hiding this comment.
Plural form should be used on names representing a collection of objects.
https://se-education.org/guides/conventions/java/basic.html#naming
| /** | ||
| * Prints out the message introducing the functionalities of Kowalski Bot | ||
| */ | ||
| public static void printIntro(){ |
There was a problem hiding this comment.
printIntro() {
maintain spacing consistently in classes and methods
| * @param userInput : String which the user inputs | ||
| * @return String which is in lowercase and clear of any unnecessary whitespace | ||
| */ | ||
| public static String processInput(String userInput){ |
There was a problem hiding this comment.
use the name to explain what the function does. perhaps you could name it trimAndMakeLowerCase() instead?
https://nus-cs2113-ay2324s2.github.io/website/se-book-adapted/chapters/codeQuality.html#use-name-to-explain
| * Prints out an accurate message for the number of tasks in the list. | ||
| * @param number : represents the total current task count | ||
| */ | ||
| public static void printCurrentTaskMessage(int number){ |
There was a problem hiding this comment.
the name number is not very descriptive, you can call is taskNumber instead ?
| for (int i = 0; i < deadlineArray.length; i++) { | ||
| deadlineArray[i] = deadlineArray[i].trim(); | ||
| } | ||
|
|
There was a problem hiding this comment.
remove one empty line (unnecessary whitespace)
| @@ -0,0 +1,255 @@ | |||
| import java.util.Scanner; | |||
There was a problem hiding this comment.
overall good use of javadoc comments
| private static Task getNewEventTask(String eventDetails) { | ||
| String[] eventArray = eventDetails.split("/from"); | ||
| String eventInformation = eventArray[0].trim(); | ||
| String [] fromAndTo = eventArray[1].split("/to"); |
There was a problem hiding this comment.
array specifiers should be attached to the type
https://se-education.org/guides/conventions/java/basic.html#types
| String[] eventArray = eventDetails.split("/from"); | ||
| String eventInformation = eventArray[0].trim(); |
There was a problem hiding this comment.
avoid magic literals by storing these as static final vars
https://nus-cs2113-ay2324s2.github.io/website/se-book-adapted/chapters/codeQuality.html#avoid-magic-numbers
| * Processes all the inputs from the user and categorises the User Commands | ||
| * @param UserCommand: The first word input by the user | ||
| */ | ||
| public static void parseUserCommand(String UserCommand) { |
There was a problem hiding this comment.
this function is very long (>>30 LOC). consider separating the code into multiple functions
| break; | ||
| } | ||
|
|
||
| try{ |
Add level 9 code
Add JavaDoc Code
No description provided.