Skip to content

Commit 3c6404c

Browse files
committed
Edit README.md
1 parent 0dbba1b commit 3c6404c

15 files changed

Lines changed: 189 additions & 68 deletions

File tree

docs/README.md

Lines changed: 156 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
# B.O.B Task Manager User Guide
22
A todo task manager bot to record and store list of tasks.
33

4+
![image](../src/main/resources/images/DaDuke.png)
5+
6+
Source: MrDestructoid (Twitch Emote)
7+
48
# Features
59
Below are the features currently implemented:
610

711
1. [**`Add`**](#add) Adding tasks to the bot.
8-
- 1.1 Todo
9-
- 1.2 Event
10-
- 1.3 Deadline
12+
- 1.1. [**`Todo`**](#todo)
13+
- 1.2. [**`Event`**](#event)
14+
- 1.3. [**`Deadline`**](#deadline)
1115
2. [**`List`**](#list) Listing all existing tasks.
1216
3. [**`Marking Done`**](#done) Mark completed tasks as done.
1317
4. [**`Delete`**](#delete) Deleting tasks using index.
14-
5. [**`Storage & Retrieval`**](#storage) Storing of tasks in local drive.
15-
6. [**`Find`**](#find) Finding tasks based on keywords.
16-
7. [**`Remind`**](#remind) Remind Users about upcoming tasks.
18+
5. [**`Find`**](#find) Finding tasks based on keywords.
19+
6. [**`Remind`**](#remind) Remind Users about upcoming tasks.
20+
7. [**`Storage & Retrieval`**](#storage) Storing of tasks in local drive.
21+
1722

1823
## Feature Details
1924

@@ -26,7 +31,7 @@ segment his tasks into.
2631
- Event
2732
- Deadline
2833

29-
### Todo
34+
### Todo<a name="todo"></a>
3035
Adds a todo task with **task description** into B.O.B Task Manager.
3136

3237
**Command Syntax**
@@ -40,11 +45,16 @@ Adds a todo task with **task description** into B.O.B Task Manager.
4045

4146
**Expected outcome:**
4247

48+
CLI:
49+
4350
ADDED: [TODO][X] read book
51+
Current Total Tasks: 1 task
52+
53+
GUI
4454

4555
![image](./images/add-todo.png)
4656

47-
### Event
57+
### Event<a name="event"></a>
4858
Adds an event task with the **task description** and
4959
**Date and Time** into B.O.B Task Manager.
5060

@@ -61,11 +71,16 @@ Adds an event task with the **task description** and
6171

6272
**Expected outcome:**
6373

74+
CLI:
75+
6476
ADDED: [EVENT][X] watch movie (at: Feb 14 2021, 17:00)
77+
Current Total Tasks: 2 tasks
78+
79+
GUI:
6580

6681
![image](./images/add-event.png)
6782

68-
### Deadline
83+
### Deadline<a name="deadline"></a>
6984
Adds a deadline task with the **task description** and
7085
**Date and Time** into B.O.B Task Manager.
7186

@@ -82,7 +97,12 @@ Adds a deadline task with the **task description** and
8297

8398
**Expected outcome:**
8499

100+
CLI:
101+
85102
ADDED: [DEADLINE][X] return book (by: Mar 11 2021, 23:59)
103+
Current Total Tasks: 3 tasks
104+
105+
GUI:
86106

87107
![image](./images/add-deadline.png)
88108

@@ -101,44 +121,155 @@ The user will be able to list all existing tasks in B.O.B Task Manager.
101121

102122
**Expected outcome:**
103123

124+
CLI:
125+
104126
Ok Human. Here are your tasks:
105127
1. [TODO][X] read book
106128
2. [EVENT][X] watch movie (at: Feb 14 2021, 17:00)
107129
3. [DEADLINE][X] return book (by: Mar 11 2021, 23:59)
108130

109-
![image](./list.png)
131+
GUI:
132+
133+
![image](./images/list.png)
110134

111135
---
112136

113-
### 4. Marking Done <a name="done"></a>
114-
115-
done <index of task>
137+
### Feature 3 - Marking Done <a name="done"></a>
138+
Marks the completion of a task using the index of the task.
116139

117-
Marks the completion, indicated by a `X` or ``. Completed tasks will display `[✓]`.
118-
The index of the task corresponds to the number of which it is listed, you can simply run `list`
119-
to check the index of the task.
140+
Completion status is indicated by a `X` or ``.
141+
142+
**Command Syntax**
143+
144+
done <index of task>
145+
146+
Note: The index of the task corresponds to the number beside it when listed, you can simply use `list`
147+
to get the index of the task.
120148

121149
**Example of usage:**
122150

123151
done 1
124152

125153
**Expected outcome:**
126154

127-
Swee la, task done liao:
128-
[T][✓] eat genki sushi
155+
CLI:
156+
157+
Noted Human. I've marked this task as done:
158+
[TODO][✓] read book
159+
160+
GUI:
161+
162+
![image](./images/done.png)
163+
164+
### Feature 4 - Delete <a name="delete"></a>
165+
Deletes a task from the list using the index of the task.
166+
167+
**Command Syntax**
168+
169+
delete <index of task>
170+
171+
Note: The index of the task corresponds to the number beside it when listed, you can simply use `list`
172+
to get the index of the task.
173+
174+
**Example of usage:**
175+
176+
delete 1
177+
178+
**Expected outcome:**
179+
180+
CLI:
181+
182+
Task deleted successfully:
183+
[TODO][✓] read book
184+
Current Total Tasks: 2 tasks
185+
186+
187+
GUI:
188+
189+
![image](./images/delete.png)
190+
191+
----
192+
193+
### Feature 5 - Find <a name="find"></a>
194+
Find task(s) from the list using a given keyword and lists only the relevant task(s).
195+
196+
**Command Syntax**
197+
198+
find <key word(s)>
199+
200+
201+
202+
**Example of usage:**
203+
204+
find book
205+
206+
**Expected outcome:**
207+
208+
CLI:
209+
210+
Ok Human. Here are the tasks I found:
211+
1: [DEADLINE][X] return book (by: Mar 11 2021, 23:59)
212+
213+
GUI:
214+
215+
![image](./images/find.png)
216+
217+
---
218+
219+
### Feature 6 - Remind <a name="find"></a>
220+
Show upcoming task(s), and optional **number of days** argument can be given to
221+
specify the maximum time span (in days) for the task to be considered 'upcoming'.
222+
223+
**Command Syntax**
224+
225+
remind
226+
or
227+
228+
remind <number of days>
229+
230+
Note: If **number of days** not specified, the default time span is 3 days.
231+
This can be configured in the line below in RemindCommand.java
232+
233+
private static final int DEFAULT_NUM_DAYS = 3;
234+
235+
Full file path relative to root of project folder: `/src/main/java/duke/command/RemindCommand.java`
236+
237+
238+
**Example of usage:**
239+
240+
remind 30
241+
242+
**Expected outcome:**
243+
244+
CLI:
129245

246+
Ok Human. Here are the tasks I found:
247+
1: [DEADLINE][X] return book (by: Mar 11 2021, 23:59)
130248

249+
GUI:
131250

132-
## Usage
251+
![image](./images/remind.png)
133252

134-
### `Keyword` - Describe action
253+
---
135254

136-
Describe action and its outcome.
255+
### Feature 7. Storage and Retrieval of Tasks <a name="storage"></a>
256+
B.O.B Task Manager will attempt to retrieve stored tasks from a storage file
257+
in your local computer. Upon launching, it will parse through the
258+
text file and populate the application with the stored data.
137259

138-
Example of usage:
260+
If there are no storage files are found, a text file named `tasks.txt` will be
261+
in created in the root directory of the project. All subsequent information will
262+
be stored in this file.
139263

140-
`keyword (optional arguments)`
264+
The default file path is set as shown below:
141265

142-
Expected outcome:
266+
private final String defaultPath = "./tasks.txt";
267+
268+
If you would like to change the default directory or change the filename,
269+
you can edit the above code in `Storage.java`.
270+
271+
Full file path relative to root of project folder: `/src/main/java/duke/Storage.java`
272+
273+
---
143274

144-
`outcome`
275+
# THE END

docs/images/add-deadline.png

37.7 KB
Loading

docs/images/add-event.png

37.1 KB
Loading

docs/images/add-todo.png

73.1 KB
Loading

docs/images/delete.png

33.6 KB
Loading

docs/images/done.png

31.6 KB
Loading

docs/images/find.png

34.7 KB
Loading

docs/images/list.png

39.3 KB
Loading

docs/images/remind.png

35.4 KB
Loading

src/main/java/duke/Ui.java

Lines changed: 21 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,10 @@
22

33
import java.io.InputStream;
44
import java.io.PrintStream;
5-
import java.time.LocalDateTime;
65
import java.util.Scanner;
76

8-
import duke.task.Deadline;
9-
import duke.task.Event;
107
import duke.task.Task;
11-
import duke.task.ToDo;
8+
129

1310

1411
/**
@@ -55,6 +52,21 @@ public String showBye() {
5552
return LINE_PREFIX + EXIT_MESSAGE + "\n";
5653
}
5754

55+
/**
56+
*
57+
* @param taskList
58+
* @return
59+
*/
60+
public String showTasksCount(TaskList taskList) {
61+
int count = taskList.getTasksCount();
62+
return (count == 1)
63+
? "Current Total Tasks: " + count
64+
+ " task"
65+
: "Current Total Tasks: " + count
66+
+ " tasks";
67+
68+
}
69+
5870
/**
5971
* Return all task in taskList as a string
6072
* @param taskList
@@ -129,41 +141,16 @@ public String showTaskDone(Task task) {
129141
* @param task
130142
* @return
131143
*/
132-
public String showTaskDeleted(Task task) {
133-
return String.format(LINE_PREFIX + "Task deleted successfully:\n[%s] [%s] %s\n",
144+
public String showTaskDeleted(Task task, TaskList taskList) {
145+
return String.format(LINE_PREFIX + "Task deleted successfully:\n[%s] [%s] %s\n%s",
134146
task.getTaskType(), task.getStatusIcon(),
135-
task.getTaskDescription());
147+
task.getTaskDescription(), showTasksCount(taskList));
136148
}
137149

138-
public String showAdd(Task task) {
139-
return String.format(LINE_PREFIX + "Added:\n%s\n", task);
150+
public String showAdd(Task task, TaskList taskList) {
151+
return String.format(LINE_PREFIX + "Added:\n%s\n%s\n", task, showTasksCount(taskList));
140152
}
141153

142-
public String showAddToDo(ToDo toDo) {
143-
return String.format(LINE_PREFIX + "Added:\n[%s] [%s] %s\n",
144-
toDo.getTaskType(), toDo.getStatusIcon(),
145-
toDo.getTaskDescription());
146-
147-
}
148-
149-
public String showAddDeadLine(Deadline deadline) {
150-
LocalDateTime time = deadline.getEndTime();
151-
return String.format(LINE_PREFIX + "Added:\n[%s] [%s] %s (by: %s %s %s %02d:%02d)\n",
152-
deadline.getTaskType(), deadline.getStatusIcon(), deadline.getTaskDescription(),
153-
time.getMonth(), time.getDayOfMonth(), time.getYear(), time.getHour(),
154-
time.getMinute());
155-
}
156-
157-
public String showAddEvent(Event event) {
158-
LocalDateTime time = event.getEventTime();
159-
return String.format(LINE_PREFIX + "Added:\n[%s] [%s] %s (at: %s %s %s %02d:%02d)\n",
160-
event.getTaskType(), event.getStatusIcon(), event.getTaskDescription(),
161-
time.getMonth(), time.getDayOfMonth(), time.getYear(), time.getHour(),
162-
time.getMinute());
163-
}
164-
165-
166-
167154
public String showError(String errorMsg) {
168155
return "[ERROR] : " + errorMsg + "\n";
169156
}

0 commit comments

Comments
 (0)