Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Nam Minh Quan] iP #41

Open
wants to merge 55 commits into
base: master
Choose a base branch
from

Conversation

quannam0124
Copy link

@quannam0124 quannam0124 commented Aug 19, 2022

#Duke Chat-bot
##This chat-bot helps you organize your to-do list. It's

  • Easy to use
  • Text-base
  • Extremely convenient

##All you need to do is:

  1. Download it from here
  2. Double click it
  3. Type in your tasks
  4. Let it manage your tasks for you 😁

And it is completely FREE!

Features:

  • Managing tasks
  • Managing deadlines (coming soon)
  • Reminders (coming soon)

If you are a Java programmer, you can use it to practice Java too. Here's the main method:

 public static void main(String[] args) {
        new Duke("data/Tasks.txt").run();
    }

Modify Duke.main() to perform taskList functions
Refactor TaskList to work with Task objects
Complete Level 3
Add Input and expected text files for testing
Level 4
Add Exception handlers
Add DukeHandler to handle responses and prevent public access to list of tasks
Fix handle logic bug
Level 6 done
The TaskStorage class handles loading and modifying the text file that saves all tasks

Let's create this class
Date and time is stored as String in Task subclasses

Let's make a class that converts string input for Times to LocalDateTime objects to be stored in task objects
# Conflicts:
#	src/main/java/Deadline.java
#	src/main/java/DukeHandler.java
#	src/main/java/Event.java
Duke is using a DukeHandler to parse user input, user interaction is being handled in multiple classes

Let's pull up behaviors common to user interaction and create a new Ui class

This helps OOP to be clearer in this project
DukeDate class modified for ease of reading
A-packages increment completed
Duke does not have test cases to verify its functions

Let's make some jUnit tests to make sure that the functions work
Duke does not have function to search for specific tasks

Let's add a findTask() method to allow this
# Conflicts:
#	src/main/java/Duke/DukeHandler.java
#	src/main/java/Duke/task/TaskList.java
# Conflicts:
#	src/main/java/Deadline.java
#	src/main/java/Duke.java
#	src/main/java/Event.java
Copy link

@Ramanathan0908 Ramanathan0908 left a comment

Choose a reason for hiding this comment

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

Great job overall!!! Just some minor nits to fix!

README.md Outdated
@@ -1,4 +1,4 @@
# Duke project template
# Duke.Duke project template

Choose a reason for hiding this comment

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

A very minor nitpick, Duke got refactored to Duke.Duke which does not make sense here.

Comment on lines 3 to 5
import Duke.task.TaskList;
import Duke.task.TaskStorage;
import Duke.util.Ui;

Choose a reason for hiding this comment

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

I would love to see a line separating task and util packages even further.

* Represents the object that the chat-bot manages
* and users can interact with.
*/
public abstract class Task {

Choose a reason for hiding this comment

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

I like how you defined Task as an abstract class 👍

Comment on lines 6 to 7
import java.util.ArrayList;
import java.util.Scanner;

Choose a reason for hiding this comment

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

Would love to see a separation between util & io packages here again

Comment on lines 1 to 12
import Duke.DukeHandler;
import Duke.task.Task;
import Duke.task.TaskList;
import Duke.task.Todo;
import org.junit.jupiter.api.Test;
import Duke.DukeException;

import java.util.ArrayList;
import java.util.Arrays;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.fail;

Choose a reason for hiding this comment

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

The import statements could be arranged better, i.e the junit ones, then java ones then duke ones etc.

Comment on lines 1 to 17
package Duke.util;

import java.util.Scanner;

public class Echo {

public Echo() {
}
public void echoInput(String input) {
Scanner userInput = new Scanner(System.in);
while (!input.equals("bye")) {
System.out.println(input);
input = userInput.nextLine();
}
System.out.println("Bye. Hope to see you again soon");
}
}

Choose a reason for hiding this comment

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

unless I am missing something, what is the point of the echo class?

Duke uses Text-based interface to communicate with users

Creating GUI using JavaFX allows a better user experience

Let's refactor Duke to return replies in String, and use JavaFX
to display them to users
Duke Manager class does not have an assertion

Let's add an assertion to notify if the response from Duke is empty
Duke Manager class does not have an assertion

Let's add an assertion to notify if the response from Duke is empty
Duke uses a DukeHandler to process input and return the output

Let's extract the parser and command processor to achieve further
OOP
Duke uses too long methods

Let's extract out some common methods to increase readability
# Conflicts:
#	src/main/java/Duke/DukeHandler.java
#	src/main/java/duke/DukeManager.java
Duke does not have a help command to show users what they can do with
the program

Let's add a help command and let users know that they can use it to see
all the commands and their formats
Duke exits before showing the bye output

By informing the user that the program is exiting, we can reassure them
that it was not a crash

Let's add a timetask function so that the program can display a goodbye
message before exiting
Duke runs does not return anything if IndexOutofBound Exception
occurred due to the user's input mark, unmark, delete's index is
larger than the task list size

Let's add TaskNotFound Exception to handle this exception and show
the user that an error has come up because of their input
Duke's font size is small and hard to read. The profile photos are
square

Let's increase the size of the font and crop the profile images so
users will have a more enjoyable experience using Duke
Duke does not handle exception when user inputs the incorrect date
format

Let's add DukeDateException to handle this error
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.

2 participants