Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
6118ea3
Level-0
quanganh2810 Jan 25, 2023
9877b90
Add ability to echo input
quanganh2810 Jan 25, 2023
bc1e77d
Add the ability to read and store user commands
quanganh2810 Jan 26, 2023
012958e
Added Task and TaskManager as the class, add Duke's abiity to record,…
quanganh2810 Jan 27, 2023
ba5a640
fix some variable-naming issues and fix further formatting issues in …
quanganh2810 Jan 30, 2023
09c76af
Add Deadline and Event as subclasses
quanganh2810 Feb 4, 2023
dc4925f
fix commit
quanganh2810 Feb 4, 2023
97f41d1
Tidy up the Duke class a little bit by refactoring and shorter print …
quanganh2810 Feb 4, 2023
af773e9
Fix error of not tracking Deadline and Event java files/ added toStri…
quanganh2810 Feb 6, 2023
452032b
Added exceptions to catch error inputs
quanganh2810 Feb 6, 2023
d47c75d
Change the way Duke says goodbye
quanganh2810 Feb 6, 2023
724ee0b
Merge branch 'master' into branch-Level-5
quanganh2810 Feb 6, 2023
4e75a59
change the way Duke says goodbye
quanganh2810 Feb 6, 2023
3cf1411
Create package called "Duke" to store all of the classes
quanganh2810 Feb 6, 2023
c209898
Changing names to comply with the coding standards
quanganh2810 Feb 27, 2023
894b7aa
Add the ability to remove tasks and implement using ArrayList
quanganh2810 Feb 27, 2023
dc3db0f
Add ability to write and read to harddrive
quanganh2810 Feb 27, 2023
b6a0710
Merge branch 'branch-Level-7'
quanganh2810 Feb 27, 2023
5fe873f
Add the ability to read and save data in a file called load.txt properly
quanganh2810 Feb 28, 2023
99531f8
Create extra classes such that the project is more OOP - Parser, UI a…
quanganh2810 Feb 28, 2023
21db370
Add the ability to find task
quanganh2810 Feb 28, 2023
08da801
Add documentation
quanganh2810 Mar 2, 2023
1aaf326
no message
quanganh2810 Mar 2, 2023
c00debc
Merge branch 'branch-A-JavaDoc'
quanganh2810 Mar 2, 2023
c9abb22
Updated the readme file
quanganh2810 Mar 2, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ bin/

/text-ui-test/ACTUAL.TXT
text-ui-test/EXPECTED-UNIX.TXT
src/main/java/Duke.class
src/main/java/Task.class
src/main/java/TaskManager.class
*.class
Binary file added IP.jar
Binary file not shown.
139 changes: 124 additions & 15 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,138 @@
# User Guide
User Guide
Features
Adding a Todo Task
Add a new Todo task to the list of tasks.

## Features
Adding a Deadline Task
Add a new Deadline task to the list of tasks.

### Feature-ABC
Adding an Event Task
Add a new Event task to the list of tasks.

Description of the feature.
Listing all Tasks
List all the tasks in the TaskManager.

### Feature-XYZ
Marking a Task as Done
Mark a task in the TaskManager as done.

Description of the feature.
Unmarking a Task
Unmark a task in the TaskManager.

## Usage
Deleting a Task
Delete a task from the TaskManager.

### `Keyword` - Describe action
Clearing all Tasks
Clear all the tasks from the TaskManager.

Describe the action and its outcome.
Finding Tasks by Keyword
Find tasks in the TaskManager by a keyword.

Example of usage:
Usage
todo - Add a Todo task
Add a new Todo task to the list of tasks.

`keyword (optional arguments)`
Example of usage:

todo read book

Expected outcome:

Roger. The following todo has been added:
[T][ ] read book
You now have 1 item in the list

deadline - Add a Deadline task
Add a new Deadline task to the list of tasks.

Example of usage:

deadline return book /by Sunday

Expected outcome:

Roger. The following deadline has been added:
[D][ ] return book (by: Sunday)
You now have 1 item in the list

event - Add an Event task
Add a new Event task to the list of tasks.

Example of usage:

event project meeting /at Monday 2pm

Expected outcome:

Roger. The following event has been added:
[E][ ] project meeting (at: Monday 2pm)
You now have 1 item in the list

list - List all Tasks
List all the tasks in the TaskManager.

Example of usage:

list

Expected outcome:

Description of the outcome.
Here are the tasks in your list:
1.[T][ ] read book
2.[D][ ] return book (by: Sunday)
3.[E][ ] project meeting (at: Monday 2pm)

mark - Mark a Task as Done
Mark a task in the TaskManager as done.

Example of usage:

mark 2

Expected outcome:

Nice! I've marked this task as done:
[D][X] return book (by: Sunday)


unmark - Unmark a Task
Unmark a task in the TaskManager.

Example of usage:

unmark 2

Expected outcome:

Nice! I've unmarked this task:
[D][ ] return book (by: Sunday)
delete - Delete a Task
Delete a task from the TaskManager.

Example of usage:

delete 2

Expected outcome:

Noted. I've removed this task:
[D][ ] return book (by: Sunday)

Example of usage:

clear

Expected outcome:

All data deleted. You have no items in your list.

find - Find Tasks by Keyword
Find tasks in the TaskManager by a keyword.

Example of usage:

find book

Expected outcome:

```
expected output
```
Here are the matching tasks in your list:
1.[T][ ] read book
32 changes: 25 additions & 7 deletions src/main/java/Duke.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
import java.util.Scanner;
import java.io.IOException;

import duke.Parser;
import duke.Storage;
import duke.TaskManager;
import duke.Ui;

/**
* Duke main class. This is the entry point for the Duke program.
*/
public class Duke {
public static void main(String[] args) {
String logo = " ____ _ \n"
+ "| _ \\ _ _| | _____ \n"
+ "| | | | | | | |/ / _ \\\n"
+ "| |_| | |_| | < __/\n"
+ "|____/ \\__,_|_|\\_\\___|\n";
System.out.println("Hello from\n" + logo);
public static void main(String[] args) throws IOException {
Ui ui = new Ui();
ui.printGreeting();
Scanner scanObj = new Scanner(System.in);
TaskManager listOfItems = new TaskManager();
listOfItems = Storage.loadFile(listOfItems);
String userCmd = scanObj.nextLine();
while (!userCmd.equals("bye")) {
Parser.handleCmd(userCmd, listOfItems, ui);
userCmd = scanObj.nextLine();
}
scanObj.close();
ui.printGoodbye();
}

}
45 changes: 45 additions & 0 deletions src/main/java/duke/Deadline.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package duke;

/**
* Represents a Deadline task with a specific due date.
* Inherits from the Task class.
*/
public class Deadline extends Task {
protected String by;

/**
* Constructor for the Deadline class.
*
* @param name the name of the deadline task
* @param isDone whether the task is marked as done or not
* @param by the due date of the task
*/
public Deadline(String name, boolean isDone, String by) {
super(name, isDone);
this.by = by;
}

/**
* Overrides the toString method to display the task's details as a string.
*
* @return a formatted string representation of the task's details
*/
public String toString() {
if (this.getIsDone() == true) {
return " [D][X] " + this.getName() + " (by: " + this.by + ")";
}
return " [D][ ] " + this.getName() + " (by: " + this.by + ")";
}

/**
* Overrides the print method to print the task details in a specific format.
*/
public void print() {
if (this.isIsDone() == false) {
System.out.println("." + this.toString());
} else {
System.out.println("." + this.toString());
}
}

}
53 changes: 53 additions & 0 deletions src/main/java/duke/Event.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package duke;

/**
* Event class represents an event task with a start time and a finish time.
* It extends the Task class and adds the startTime and finishTime attributes.
*/
public class Event extends Task {
protected String startTime;
protected String finishTime;

/**
* Constructs an Event object with a name, completion status, start time, and
* finish time.
*
* @param name the name of the event task
* @param isDone the completion status of the event task
* @param startTime the start time of the event task
* @param finishTime the finish time of the event task
*/
public Event(String name, boolean isDone, String startTime, String finishTime) {
super(name, isDone);
this.startTime = startTime;
this.finishTime = finishTime;
}

/**
* Returns a string representation of the event task with its completion status,
* name, start time, and finish time.
* If the task is completed, the completion status is marked with an 'X',
* otherwise it is marked with a space.
*
* @return a string representation of the event task
*/
public String toString() {
if (this.getIsDone() == true) {
return " [E][X] " + this.getName() + " (from: " + this.startTime
+ " to: " + this.finishTime + ")";
}
return " [E][ ] " + this.getName() + " (from: " + this.startTime
+ " to: " + this.finishTime + ")";
}

/**
* Prints the string representation of the event task with a dot prefix.
*/
public void print() {
if (this.isIsDone() == false) {
System.out.println("." + this.toString());
} else {
System.out.println("." + this.toString());
}
}
}
Loading