Skip to content

[Himeth Thewmika] iP#193

Open
himethcodes wants to merge 36 commits intonus-cs2113-AY2425S2:masterfrom
himethcodes:master
Open

[Himeth Thewmika] iP#193
himethcodes wants to merge 36 commits intonus-cs2113-AY2425S2:masterfrom
himethcodes:master

Conversation

@himethcodes
Copy link
Copy Markdown

This PR contains my implementation of the Individual Project (iP) for CS2113 Module.
Features implemented so far:

  • Level-1: Greet, Echo, Exit
  • Level-2: Add, List
  • Level-3: Mark as Done, Unmark
  • A-Classes: Used a Task class to represent tasks

More features will be added progressively.

Copy link
Copy Markdown

@swethacool swethacool left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code is easy to read and comment on due to breaking it down into smaller methods with different functionalities of its own.

}
}

scanner.close(); // Close the scanner
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scanner.close() is placed inside a method, not at the end of main(). This causes an error when trying to read further inputs.

System.out.println("____________________________________________________________");
}

private static void markTaskAsDone(String command) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small methods make the code modular and easy to read

Comment on lines -5 to -6
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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tasks is declared twice: once as an array of Task[] and once as String[], leading to inconsistent task handling.

Copy link
Copy Markdown

@aditichadha1310 aditichadha1310 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall, good job!


@Override
public String toString() {
return "[D]" + super.toString() + " (by: " + by + ")";
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid the usage of magic strings

import java.util.ArrayList;
import java.util.Scanner;

public class BuddyBot {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments are missing for most methods and classes. Please add them as they increase the readability of the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants