Conversation
src/main/java/GermaBot.java
Outdated
| } | ||
|
|
||
| public static void main(String[] args) { | ||
| String WelcomeMessage = "____________________ \n" |
There was a problem hiding this comment.
Perhaps can use a constant or a method for the divider line
src/main/java/GermaBot.java
Outdated
| import java.util.Scanner; | ||
|
|
||
| public class GermaBot { | ||
| public static int getIdx(String input) { |
There was a problem hiding this comment.
Perhaps can rename to getIndex to make it more readable when as your code gets much bigger
src/main/java/GermaBot.java
Outdated
| String echo; | ||
| Scanner in = new Scanner(System.in); | ||
| echo = in.nextLine(); | ||
| if (echo.equals("bye")) { |
There was a problem hiding this comment.
A bit nitpicky but you can include your goodbye message code here. Would make the code more readable.
src/main/java/GermaBot.java
Outdated
| printCounter++; | ||
| } | ||
| } else if (echo.contains("unmark")) { | ||
| int idx = getIdx(echo); |
There was a problem hiding this comment.
Similar to the comment for getIndex. Perhaps can name "idx" to some other variable name which is more easy to follow when debugging.
NeoMinWei
left a comment
There was a problem hiding this comment.
Good job on your coding standards, however there are some code quality improvements to be made
|
|
||
| public class GermaBot { | ||
| static int counter = 0; | ||
| static final String LINE= "____________________________________________"; |
| } | ||
|
|
||
| public static void createTodo(String input) throws EmptyTaskException { | ||
| String toDoTask = input.substring(input.indexOf("todo ") + 5); |
| if (idxOfEndDate == -1) { | ||
| throw new MissingDeadlineException(); | ||
| } | ||
| String date = description.substring( idxOfEndDate + 4); |
There was a problem hiding this comment.
what does 4 here stand for? do check through your code for more magic numbers
There was a problem hiding this comment.
| String date = description.substring( idxOfEndDate + 4); | |
| String date = description.substring(idxOfEndDate + 4); |
| } | ||
|
|
||
| } |
There was a problem hiding this comment.
why is there a newline between these 2 brackets?
| } else { | ||
| int printCounter = 1; | ||
| System.out.println("Gotcha! Here are your tasks:"); | ||
| for (int i = 0; i < counter; i++) { | ||
| if (toDoList[i] == null) { | ||
| break; | ||
| } | ||
| System.out.println(printCounter + ". " + toDoList[i].toString()); | ||
| printCounter++; | ||
| } | ||
| } |
There was a problem hiding this comment.
this part is deeply nested, try to avoid deep nesting
| } | ||
| } | ||
|
|
||
| public static void main(String[] args) { |
There was a problem hiding this comment.
this method is very long, try to shorten it
add find function and create new IllegalArgumentException
add javadoc comments to classes
# Conflicts: # src/main/java/MainRuntime/GermaBot.java
No description provided.