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

[CHEN ZIHAN] ip #198

Open
wants to merge 34 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
1f84246
This is greed for level0
ZIZI-czh Jan 31, 2023
a1b47d9
edit duke
ZIZI-czh Jan 31, 2023
150d2b1
This is level 1 code
ZIZI-czh Jan 31, 2023
9fb9073
This is level 2
ZIZI-czh Jan 31, 2023
1948f11
Level 3: Mark as Done
ZIZI-czh Feb 4, 2023
20513b3
Level 4: ToDos, Events, Deadlines
ZIZI-czh Feb 14, 2023
2f37e5d
A-TextUiTesting: Automated Text UI Testing
ZIZI-czh Feb 14, 2023
aad1876
A-CodeQuality: Improve Code Quality
ZIZI-czh Feb 14, 2023
52c2484
This is branch-Level-5 which includes Level 5: Handle Errors
ZIZI-czh Feb 14, 2023
2531402
This is branch-level-5 which includes Level 5: Handle Errors
ZIZI-czh Feb 14, 2023
46b06d9
update brach for package
ZIZI-czh Feb 16, 2023
bc3b345
create package and assign each file to the respective packages
ZIZI-czh Feb 16, 2023
feac7eb
This is incomplete delete
ZIZI-czh Feb 16, 2023
96306a3
Solve merge conflict
ZIZI-czh Feb 16, 2023
31edec0
This is level 6
ZIZI-czh Feb 16, 2023
3d14bd2
Change in branch-level-6
ZIZI-czh Feb 16, 2023
5673757
Level 6 and part of level 7
ZIZI-czh Feb 24, 2023
cd4ec76
no message
ZIZI-czh Feb 24, 2023
07841ce
This is level 7
ZIZI-czh Feb 25, 2023
3bce789
This is level 7
ZIZI-czh Feb 25, 2023
18ced02
solve conflict
ZIZI-czh Feb 26, 2023
a8b8903
clean space
ZIZI-czh Mar 4, 2023
8260134
A-moreOOP
ZIZI-czh Mar 5, 2023
c6c4e31
solve for conflict
ZIZI-czh Mar 5, 2023
c44b7a0
Implement the function of find
ZIZI-czh Mar 5, 2023
da48b0a
level-9 formatting
ZIZI-czh Mar 5, 2023
31518e0
This is JavaDoc
ZIZI-czh Mar 5, 2023
144ebda
changes
ZIZI-czh Mar 5, 2023
aca6055
Update README
ZIZI-czh Mar 5, 2023
3d4ec2e
Update README
ZIZI-czh Mar 6, 2023
91ab442
update
ZIZI-czh Mar 6, 2023
2ca723e
update
ZIZI-czh Mar 9, 2023
9717c16
Merge branch 'master' into branch-Level-9
ZIZI-czh Mar 15, 2023
330455f
Merge pull request #1 from ZIZI-czh/branch-Level-9
ZIZI-czh Mar 15, 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
1 change: 1 addition & 0 deletions data/tasklist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
T | Not Done | rice
262 changes: 250 additions & 12 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,267 @@
# User Guide

## Features
## Table of Contents
<!-- TOC -->
* [User Guide](#user-guide)
* [Features](#features)
* [Task Type 1: `Todo`](#task-type-1--todos)
* [Task Type 2: `Event`](#task-type-2--events)
* [Task Type 3: `Deadline`](#task-type-3--deadlines)
* [Find Tasks By Keyword](#find-tasks-by-description)
* [Task Completion Status](#task-completion-status)
* [Task Deletion](#task-deletion)
* [Task Data Storage](#task-data-storage)
* [Usage](#usage)
* [`todo` - New Todo Task](#todo---new-todo-task)
* [`deadline` - New Deadline Task](#deadline---new-deadline-task)
* [`event` - New Event Task](#event---new-event-task)
* [`list` - List all Tasks](#list---list-all-tasks)
* [`mark` - Marks a Task as done](#mark---marks-a-task-as-done)
* [`unmark` - Marks a Task as not done](#unmark---marks-a-task-as-not-done)
* [`delete` - Deletes a Task](#delete---deletes-a-task)
* [`find` - Find Task by Keyword](#find---find-task-by-keyword)
* [`bye` - Terminate the program](#bye---shut-down-program)
<!-- TOC -->

### Feature-ABC
## Features

Description of the feature.
### Task Type 1: `Todo`

### Feature-XYZ
The function of 'Todo' is to record the planning, like what are the things are reuqred to be done.

Description of the feature.
### Task Type 2: `Event`

Event can be considered as part of the Todo, but it required the **start date and/or time** and **end date and/or time**, which can be more specific.

### Task Type 3: `Deadline`

Another kind of Todo is Deadline which has a specified **due date** so that the user can track the deadline for the task. Therefore, the priority of the tasks can be visualized.

### Find Tasks By Description

After creating many tasks, users can type a certain **keyword** to find the tasks that have been created before. As such, all the related tasks can be reviewed.

### Task Completion Status

All Tasks can be marked **done** or **not done**, so it helps to keep tracking the completion of the tasks <br><br>
The status of the tasks can be indicated by `[X]` if a task is completed or an empty box `[ ]` if the task haven't been completed yet.

### Task Deletion

Users can **delete** a task if they no longer need it in the task list.

### Task Data Storage

A list of Tasks can be recorded in computer's storage and _restore it_ the next time when the program start. <br><br>
The data memories will be stored in the data\taskList.txt file.

## Usage

### `Keyword` - Describe action
### `todo` - New Todo Task

Creates a new Todo Task with the specific requirement and uncompleted status.

Describe the action and its outcome.
**Syntax**:

Example of usage:
`todo (task-that-need-to-be-done)`

`keyword (optional arguments)`
**Example of usage**:

Expected outcome:
`todo buy food`

Description of the outcome.
**Expected outcome**:

```
expected output
todo buy food
____________________________________________________________
Got it. I've added this task:
[T][ ] buy food
Now you have 1 tasks in the list.
____________________________________________________________
```

### `deadline` - New Deadline Task

Creates a new Deadline Task with the given description and due date.

**Syntax**:

`deadline (task-description) /by (deadline-with-time)`

**Example of usage**:

`deadline CS2113 Assignmentt /by 3 March`

**Expected outcome**:

Rica will remember that you have a deadline called 'Fall asleep' to meet by 10pm, which is added to your list of Tasks.

```
deadline Fall asleep /by 10pm
____________________________________________________________
Got it. I've added this task:
[D][ ] CS2113 Assignmentt (by: 3 March)
Now you have 2 tasks in the list.
____________________________________________________________
```

### `event` - New Event Task

Creates a new Event Task with the given description, start date/time and end date/time.

**Syntax**:

`event (tassk-description) /from (start-date) /to (end-date)`

**Example of usage**:

`event shopping /from 4pm /to 8:30pm`

**Expected outcome**:

Rica will keep in mind that you want to 'Watch sunset' from 7pm to 7.15pm, and this Deadline is added to your list of Tasks.

```
event shopping /from 4pm /to 8.30pm
____________________________________________________________
Got it. I've added this task:
[E][ ] shopping (from: 4pm to: 8:30pm)
Now you have 1 tasks in the list.
____________________________________________________________
```

### `list` - List all Tasks

Lists all Tasks that Rica currently remembers along with their completion status.

**Example of usage**:

`list`

**Expected outcome**:

Description of all the Tasks that have been entered as well as which Tasks are done or not done.

```
list
____________________________________________________________
Here are the task in your list:
1.[E][ ] shopping (from: 4pm to: 8:30pm)
____________________________________________________________
```

### `mark` - Marks a Task as done

Given the Task number based on the task list, mark the corresponding Task as done by the user.

**Syntax**:

`mark (task-index)`

**Example of usage**:

`mark 1`

**Expected outcome**:

Index 1 of the task list is now done, so it will update this task as done in the task list.

```
mark 1
____________________________________________________________
Nice! I've marked this task as done:
[E][X] shopping (from: 4pm to: 8:30pm)
____________________________________________________________
```

### `unmark` - Marks a Task as not done




**Syntax**:

`unmark (task-index)`

**Example of usage**:

`unmark 1`

**Expected outcome**:

Index 1 of the task list is now not done, so it will update this task as not done in the task list

```
unmark 1
____________________________________________________________
Nice! I've marked this task as done:
[E][X] shopping (from: 4pm to: 8:30pm)
____________________________________________________________
```

### `delete` - Deletes a Task

Given the Task number based on the task list, delete the corresponding Task by the user.

**Syntax**:

`delete (task-number)`

**Example of usage**:

`delete 1`

**Expected outcome**:

Index 1 of the task list is now deleted, so it will be deleted from the task list.

```
delete 1
____________________________________________________________
Noted. I've removed this task:
[E][ ] project meeting (from: Aug 6th 2pm to: 4pm)
Now you have 4 tasks in the list.
____________________________________________________________
```

### `find` - Find Task by Keyword

Given a keyword, a list of all Tasks with a matching description will be shown.

**Syntax**:

`find (keyword)`

**Example of usage**:

`find book`

**Expected outcome**:

Task with a description containing the word 'book' is shown to the user.

```
find book
____________________________________________________________
Here are the matching tasks in your list:
1.[T][X] read book
2.[D][X] return book (by: June 6th)
____________________________________________________________
```

### `bye` - Turns Program Off

The program will shut down.

**Example of usage**:

`bye`

**Expected outcome**:


```
____________________________________________________________
Bye. Hope to see you again soon!
____________________________________________________________
```
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: duke.Duke

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

import duke.instructions.*;
import java.util.ArrayList;
public class Duke {

private static final ArrayList<Task> taskNameList = new ArrayList<>();
private static String filePath = "data/tasklist.txt";


public Duke(String filePath) {

try {
Storage.readFile(filePath, taskNameList);
} catch (java.io.FileNotFoundException e) {
Ui.showNotFoundError();
}
}

/**
* The starting and ending of the program
* This methods will keep checking if "bye" is entered by the user
*
*/
public static void run() {

Ui.greeting();
boolean isRunning = true;
while (isRunning) {
isRunning = Parser.checkInput(taskNameList, filePath);
}
Parser.sayBye();

}


public static void main(String[] args) {
new Duke(filePath).run();
}
}
9 changes: 9 additions & 0 deletions src/main/java/duke/DukeException.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

package duke;

public class DukeException extends Exception{
public DukeException(String message) {
super(message);
}

}
Loading