Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
c456ebc
Level 0. Greet
LI-XINYI1 Feb 3, 2022
3cfc68a
Add Echo between greet and exit
LI-XINYI1 Feb 4, 2022
25057ce
println text editing
LI-XINYI1 Feb 10, 2022
6fc6761
Add,List
LI-XINYI1 Feb 10, 2022
160d9f5
Mark as Done: add Task class; add markdone and unmark commands
LI-XINYI1 Feb 10, 2022
e644ce9
Following the Coding Standard
LI-XINYI1 Feb 10, 2022
a1f4a4c
Level-4: ToDos. Events. Deadlins
LI-XINYI1 Feb 10, 2022
8626a53
A-CodeQuality : improve code quality
LI-XINYI1 Feb 11, 2022
5cae0c1
Level 5. Handle Errors
LI-XINYI1 Feb 11, 2022
9c9c25d
Revert "Level 5. Handle Errors"
LI-XINYI1 Feb 11, 2022
e168289
restart over
LI-XINYI1 Feb 11, 2022
174efb8
Level 5. Handle Errors
LI-XINYI1 Feb 11, 2022
52343ca
Level 5: Merge branch 'branch-Level-5'
LI-XINYI1 Feb 11, 2022
3c337e2
Improve code quality and fix previous bugs
LI-XINYI1 Feb 18, 2022
b820e7b
change TaskManager from arrary to ArrayList
LI-XINYI1 Feb 18, 2022
e26b13e
Level 6. Delete : Add support for deleting tasks from the list.
LI-XINYI1 Feb 18, 2022
89b1254
add exception handler (try catch)
LI-XINYI1 Feb 18, 2022
c0a0f96
improve code quality and clarity
LI-XINYI1 Feb 18, 2022
64b1370
Level 7.save. Add record txt file.
LI-XINYI1 Feb 18, 2022
45431b8
Merge branch 'master' into branch-Level-7
LI-XINYI1 Feb 18, 2022
041d1b7
merge branch-level-6 and master
LI-XINYI1 Feb 18, 2022
090c906
A-Jar : create a jar file
LI-XINYI1 Feb 18, 2022
b952559
Merge branch 'master' into branch-Level-6
LI-XINYI1 Feb 18, 2022
839d11a
Merge commit '090c9061e2909836e17b214234829ef3e012e1ef'
LI-XINYI1 Feb 18, 2022
68faea8
Debug and improve code quality.
LI-XINYI1 Feb 18, 2022
03e38ad
A-MoreOOP:Make the code more OOP
LI-XINYI1 Mar 3, 2022
9a188e8
Level 9: find: find a task by searching for a keyword
LI-XINYI1 Mar 3, 2022
aef7fc4
Merge pull request #1 from LI-XINYI1/branch-Level-9
LI-XINYI1 Mar 3, 2022
cfeeb90
Level-8: dates and times
LI-XINYI1 Mar 4, 2022
6deefc4
Merge pull request #2 from LI-XINYI1/branch-Level-8
LI-XINYI1 Mar 4, 2022
a0dc9d0
A-JavaDoc: Add JavaDoc comments to the code.
LI-XINYI1 Mar 4, 2022
8b8ab17
Merge pull request #3 from LI-XINYI1/branch-A-JavaDoc
LI-XINYI1 Mar 4, 2022
764dd9d
A-UserGuide: Add a User Guide
LI-XINYI1 Mar 4, 2022
6374f84
improve code quality
LI-XINYI1 Mar 4, 2022
4c5e030
add help message and method
LI-XINYI1 Mar 4, 2022
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
132 changes: 117 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,126 @@
# Duke project template
# Duke project: the task management chatbot
## project user guide

This is a project template for a greenfield Java project. It's named after the Java mascot _Duke_. Given below are instructions on how to use it.
* This is a CLI(command line interface) task management application named Baymax.
*

## Setting up in Intellij

Prerequisites: JDK 11, update Intellij to the most recent version.

1. Open Intellij (if you are not in the welcome screen, click `File` > `Close Project` to close the existing project first)
1. Open the project into Intellij as follows:
2. Open the project into Intellij as follows:
1. Click `Open`.
1. Select the project directory, and click `OK`.
1. If there are any further prompts, accept the defaults.
1. Configure the project to use **JDK 11** (not other versions) as explained in [here](https://www.jetbrains.com/help/idea/sdk.html#set-up-jdk).<br>
2. Select the project directory, and click `OK`.
3. If there are any further prompts, accept the defaults.
3. Configure the project to use **JDK 11** (not other versions) as explained in [here](https://www.jetbrains.com/help/idea/sdk.html#set-up-jdk).<br>
In the same dialog, set the **Project language level** field to the `SDK default` option.
3. After that, locate the `src/main/java/Duke.java` file, right-click it, and choose `Run Duke.main()` (if the code editor is showing compile errors, try restarting the IDE). If the setup is correct, you should see something like the below as the output:
```
Hello from
____ _
| _ \ _ _| | _____
| | | | | | | |/ / _ \
| |_| | |_| | < __/
|____/ \__,_|_|\_\___|
```
4. After that, locate the `src/main/java/Baymax.java` file, right-click it, and choose `Run Baymax.main()` (if the code editor is showing compile errors, try restarting the IDE). If the setup is correct, you should see something like the below as the output:

```
Hello, I'm Baymax.
Your personal task managing companion.
What can I do for you?
```

5. The application now should run in the console.
6. Now you can interact with the program in the console.


*Using Command Line*

1. 'Build' the project using IntelliJ.
2. Open the `Terminal`/`Command Prompt`.
3. `cd` into the project's `out\production\ip` directory
4. Type `java Baymax`, then press enter to execute.
5. Now you can interact with the program through the CLI..


## Features
### three types of tasks
### 1. Feature-event:
- event is a subclass of task, with description and date.
### 2. Feature-deadline:
- deadline is a subclass of task, with description and due date.
### 3. Feature-todo:
- todo is a subclass of task, with description of the task.

## Usage
1. Adding a todo task
* Add a todo task to the list of tasks.
* Format: `todo <description>`
* Words inside `< >` are parameters. There is no need to type the `<` and `>`.
* Example of usage:`todo Read textbook`
* Expected oucome:
```
Got it. I've added this task:
[T][ ] Read textbook
Now you have 1 tasks tasks in the list.
```

2. Adding a deadline task
* Add a deadline task to the list of tasks.
* Format: `deadline <task> /by <MM dd yyyy>`
* Example:
* `deadline Submit lab report /by 03 04 2022`
* Expected oucome:
```
Got it. I've added this task:
[D][ ] Submit lab report /by 03 04 2022`
Now you have 2 tasks tasks in the list.
```
3. Adding a event task
* Add an event task to the list of tasks.
* Format: `event <task> /at <MM dd yyyy>`
* Example:
* `event Attend meeting /at 03 04 2022`
* Expected oucome:
```
Got it. I've added this task:
[E][ ] Submit lab report /by 03 04 2022`
Now you have 3 tasks tasks in the list.
```

4. Listing all tasks: `list`
* Display the entire list of tasks.
* Format: `list`
* Expected oucome:

```
Here are the tasks in your list:
1.[T][ ] Read textbook
2.[D][ ] Submit lab report /by 03 04 2022
3.[E][ ] Submit lab report /by 03 04 2022`
```
5. Finding all tasks containing a keyword in their description: `find`
* Find all the tasks whose description contains the specified keyword.
* Format: `find <keyword>`
* Example:
* `find meeting` +
Returns all tasks containing `meeting` in description.

6. Deleting a task: `delete`
* Delete a task by specifying the index of it.
* Format: `delete <index>`
* Example:
* `delete 2` +
Deletes the second task in the task list.

7. Marking a task: `mark`
* Mark a task as done by specifying the index of it.
* Format: `mark <index>`
* Example:
* `mark 3` +
Marks the third task in the task list as done.

8. Marking a task: `unmark`
* Unmark a task as not done yet by specifying the index of it.
* Format: `unmark <index>`
* Example:
* `mark 1` +
Unmark the first task in the task list.

9. Exiting the program: `bye`
* Exit the program.
* Format: `bye`
* Expected output:`Bye, Hope to see you again soon!`
4 changes: 4 additions & 0 deletions data/Baymax.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
D / 0 / xinyi submit cs2113 ip / 03 02 2022
E / 1 / xinyi learns lecture / 03 29 2022
T / 0 / xinyi practice coding /
T / 0 / Mark release a jar file /
125 changes: 111 additions & 14 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,126 @@
# User Guide
# Duke project: the task management chatbot
## project user guide

## Features
* This is a CLI(command line interface) task management application named Baymax.
*

### Feature-ABC
## Setting up in Intellij

Description of the feature.
Prerequisites: JDK 11, update Intellij to the most recent version.

### Feature-XYZ
1. Open Intellij (if you are not in the welcome screen, click `File` > `Close Project` to close the existing project first)
2. Open the project into Intellij as follows:
1. Click `Open`.
2. Select the project directory, and click `OK`.
3. If there are any further prompts, accept the defaults.
3. Configure the project to use **JDK 11** (not other versions) as explained in [here](https://www.jetbrains.com/help/idea/sdk.html#set-up-jdk).<br>
In the same dialog, set the **Project language level** field to the `SDK default` option.
4. After that, locate the `src/main/java/Baymax.java` file, right-click it, and choose `Run Baymax.main()` (if the code editor is showing compile errors, try restarting the IDE). If the setup is correct, you should see something like the below as the output:

Description of the feature.
```
Hello, I'm Baymax.
Your personal task managing companion.
What can I do for you?
```

5. The application now should run in the console.
6. Now you can interact with the program in the console.

## Usage

### `Keyword` - Describe action
*Using Command Line*

Describe the action and its outcome.
1. 'Build' the project using IntelliJ.
2. Open the `Terminal`/`Command Prompt`.
3. `cd` into the project's `out\production\ip` directory
4. Type `java Baymax`, then press enter to execute.
5. Now you can interact with the program through the CLI..

Example of usage:

`keyword (optional arguments)`
## Features
### three types of tasks
### 1. Feature-event:
- event is a subclass of task, with description and date.
### 2. Feature-deadline:
- deadline is a subclass of task, with description and due date.
### 3. Feature-todo:
- todo is a subclass of task, with description of the task.

## Usage
1. Adding a todo task
* Add a todo task to the list of tasks.
* Format: `todo <description>`
* Words inside `< >` are parameters. There is no need to type the `<` and `>`.
* Example of usage:`todo Read textbook`
* Expected oucome:
```
Got it. I've added this task:
[T][ ] Read textbook
Now you have 1 tasks tasks in the list.
```

Expected outcome:
2. Adding a deadline task
* Add a deadline task to the list of tasks.
* Format: `deadline <task> /by <MM dd yyyy>`
* Example:
* `deadline Submit lab report /by 03 04 2022`
* Expected oucome:
```
Got it. I've added this task:
[D][ ] Submit lab report (by: 03 04 2022)
Now you have 2 tasks tasks in the list.
```
3. Adding a event task
* Add an event task to the list of tasks.
* Format: `event <task> /at <MM dd yyyy>`
* Example:
* `event Attend meeting /at 03 04 2022`
* Expected oucome:
```
Got it. I've added this task:
[E][ ] Submit lab report (by: 03 04 2022)
Now you have 3 tasks tasks in the list.
```

Description of the outcome.
4. Listing all tasks: `list`
* Display the entire list of tasks.
* Format: `list`
* Expected oucome:

```
expected output
Here are the tasks in your list:
1 [T][ ] Read textbook
2 [D][ ] Submit lab report (by: 03 04 2022)
3 [E][ ] Submit lab report (at: 03 04 2022)
```
5. Finding all tasks containing a keyword in their description: `find`
* Find all the tasks whose description contains the specified keyword.
* Format: `find <keyword>`
* Example:
* `find meeting` +
Returns all tasks containing `meeting` in description.

6. Deleting a task: `delete`
* Delete a task by specifying the index of it.
* Format: `delete <index>`
* Example:
* `delete 2` +
Deletes the second task in the task list.

7. Marking a task: `mark`
* Mark a task as done by specifying the index of it.
* Format: `mark <index>`
* Example:
* `mark 3` +
Marks the third task in the task list as done.

8. Marking a task: `unmark`
* Unmark a task as not done yet by specifying the index of it.
* Format: `unmark <index>`
* Example:
* `mark 1` +
Unmark the first task in the task list.

9. Exiting the program: `bye`
* Exit the program.
* Format: `bye`
* Expected output:`Bye, Hope to see you again soon!`
58 changes: 58 additions & 0 deletions src/main/java/Baymax.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import java.lang.String;

import java.io.IOException;

import baymax.data.TaskManager;
import baymax.ui.Ui;
import baymax.parse.Parser;
import baymax.storage.Storage;

/**
* Enter point for Baymax task management bot
* Initialize the task manager
*/
public class Baymax {

/**
* initialize UI, taskmanager, and storage.
* @param filePath the txt file location where
* the application read from and store in
*/
private final Ui ui;
private TaskManager tManager;

public Baymax(String filePath) {
ui = new Ui();
Storage storage = new Storage(filePath);
try {
tManager = new TaskManager(storage.load());
} catch (IOException e) {
ui.showLoadingError(e.getMessage());
tManager = new TaskManager();
}
}

/**
* Read user input
* keep iteration until exit signal is sent
* @throws IOException
*/
public void run() throws IOException {
ui.displayWelcomeMessage();
boolean isBye;
isBye = false;
while (!isBye) {
String fullCommand = ui.getUserCommand();
Parser parse = new Parser(ui);
parse.parse(fullCommand, tManager);
isBye = parse.getExit();
}
ui.showByeMessage();
}

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


5 changes: 5 additions & 0 deletions src/main/java/BaymaxException.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
public class BaymaxException extends RuntimeException{
public BaymaxException(String errorMessage){
super(errorMessage);
}
}
10 changes: 0 additions & 10 deletions src/main/java/Duke.java

This file was deleted.

3 changes: 3 additions & 0 deletions src/main/java/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Manifest-Version: 1.0
Main-Class: Baymax

Loading