[Himeth Thewmika] iP#193
Conversation
swethacool
left a comment
There was a problem hiding this comment.
Code is easy to read and comment on due to breaking it down into smaller methods with different functionalities of its own.
ip/src/main/java/BuddyBot.java
Outdated
| } | ||
| } | ||
|
|
||
| scanner.close(); // Close the scanner |
There was a problem hiding this comment.
scanner.close() is placed inside a method, not at the end of main(). This causes an error when trying to read further inputs.
ip/src/main/java/BuddyBot.java
Outdated
| System.out.println("____________________________________________________________"); | ||
| } | ||
|
|
||
| private static void markTaskAsDone(String command) { |
There was a problem hiding this comment.
small methods make the code modular and easy to read
ip/src/main/java/BuddyBot.java
Outdated
| private static Task[] tasks = new Task[MAX_TASKS]; | ||
| private static int taskCount = 0; | ||
|
|
||
| public static void main(String[] args) { | ||
| Scanner scanner = new Scanner(System.in); | ||
| String[] tasks = new String[100]; // Array to store tasks |
There was a problem hiding this comment.
tasks is declared twice: once as an array of Task[] and once as String[], leading to inconsistent task handling.
|
|
||
| @Override | ||
| public String toString() { | ||
| return "[D]" + super.toString() + " (by: " + by + ")"; |
There was a problem hiding this comment.
Avoid the usage of magic strings
ip/src/main/java/BuddyBot.java
Outdated
| import java.util.ArrayList; | ||
| import java.util.Scanner; | ||
|
|
||
| public class BuddyBot { |
There was a problem hiding this comment.
Comments are missing for most methods and classes. Please add them as they increase the readability of the code.
This PR contains my implementation of the Individual Project (iP) for CS2113 Module.
Features implemented so far:
More features will be added progressively.