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

[Tze Loong] iP #213

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
7558b46
Level 0 Greet
TzeLoong Feb 1, 2023
dbc5dac
Level 1. Greet, Echo, Exit
TzeLoong Feb 1, 2023
f808559
Level 2. Add, List
TzeLoong Feb 1, 2023
50aad95
Level-3
TzeLoong Feb 2, 2023
312117e
Update Tasks.java
TzeLoong Feb 2, 2023
98bc638
Coding Standard
TzeLoong Feb 2, 2023
2306a2a
Level-4
TzeLoong Feb 9, 2023
cb74c50
Level-4
TzeLoong Feb 16, 2023
fe13d52
Level-4
TzeLoong Feb 17, 2023
f5259c3
Create Duke.jar
TzeLoong Feb 17, 2023
dc3b488
Delete Duke.jar
TzeLoong Feb 17, 2023
7b1e715
Handle errors
TzeLoong Feb 18, 2023
88c2683
Use of ArrayList<Task>
TzeLoong Feb 18, 2023
1712749
Delete
TzeLoong Feb 18, 2023
de06295
Save
TzeLoong Feb 27, 2023
3b1d6d4
Save
TzeLoong Feb 27, 2023
409496b
Level-7
TzeLoong Feb 27, 2023
8c09680
Level-7
TzeLoong Feb 28, 2023
d44a21d
Level-9
TzeLoong Feb 28, 2023
1e53d33
Added comments
TzeLoong Feb 28, 2023
2b06b30
Added JavaDoc comments
TzeLoong Feb 28, 2023
9a1c515
Merge pull request #1 from TzeLoong/A-JavaDoc
TzeLoong Feb 28, 2023
57076f4
Changes
TzeLoong Mar 1, 2023
b847776
Changes
TzeLoong Mar 1, 2023
c8ce553
Changes
TzeLoong Mar 1, 2023
6df5295
Changes
TzeLoong Mar 2, 2023
212cf99
Updated userguide
TzeLoong Mar 3, 2023
7e9c93f
Update Tasklist.java
TzeLoong Mar 3, 2023
b624d2a
Merge branch 'master' of https://github.com/TzeLoong/ip
TzeLoong Mar 3, 2023
6009396
Added comments
TzeLoong Mar 3, 2023
da04bb5
Create ip.jar
TzeLoong Mar 3, 2023
c7ddfbe
Improvements for v2-updated
TzeLoong Mar 19, 2023
1ad8a59
Improvements for v0.2-updated
TzeLoong Mar 19, 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
190 changes: 181 additions & 9 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,201 @@
# User Guide

Nova is a command-line (CLI) chatbot application that helps you keep track of your tasks.

## Features

### Feature-ABC
### Adding tasks to your list

You can add three different types of tasks:
1. todo
2. deadline
3. event

### Printing your list of tasks

You can view the tasks listed currently

### Mark your tasks

You can mark/unmark your tasks if you have completed/yet to complete them.

### Find tasks by keyword

Description of the feature.
You can find tasks that matches a specific keyword in your list

### Feature-XYZ
### Delete your tasks

Description of the feature.
You can delete specific tasks from the list

### Save your tasks

Your tasks are saved after you exit the program and loaded once you reopen

## Usage

### `Keyword` - Describe action
### `list` - Displaying the current list of tasks

Prints out the tasks in the list

Example of usage:

`list`

Expected outcome:

Nova will acknowledge and display the updated list

```
Here are all of your 3 tasks:
1.[T][ ] run
2.[D][ ] eat (by: 14 July 2023 6pm)
3.[E][ ] sleep ( from 1 June to 2 June)
```

### `todo` - Adds a new task of type: Todo

Adds a new task and updates the current number of tasks in the list

Example of usage:

`todo {description}`
e.g. {todo read}

Expected outcome:

Nova will acknowledge the added task and display the updated number of tasks

```
I have added this task:
[T][ ] read
You now have 4 tasks in the list.
```

### `deadline` - Adds a new task of type: deadline

Adds a new task with a deadline and updates the current number of tasks in the list

Example of usage:

`deadline {description /by deadline}`
e.g. {deadline eat /by 14 July 2023 6pm}

Expected outcome:

Nova will acknowledge the added task and display the updated number of tasks

```
I have added this task:
[D][ ] eat (by: 14 July 2023 6pm)
You now have 5 tasks in the list.
```

### `event` - Adds a new task of type: event

Adds a new task regarding an event and updates the current number of tasks in the list

Example of usage:

`event {description /from date /to date}`
e.g. {event sleep /from 1 June /to 2 June}

Expected outcome:

Nova will acknowledge the added task and display the updated number of tasks

```
I have added this task:
[E][ ] sleep ( from 1 June to 2 June)
You now have 6 tasks in the list.
```

### `mark` - Mark a specific task by index

Marks a task according to its index in the list

Example of usage:

`mark {index}`

Expected outcome:

Nova will acknowledge and display the marked task

```
Nice! This task is completed
[D][X] eat (by: 14 July 2023 6pm)
```

### `unmark` - Unmarks a specific task by index

Describe the action and its outcome.
Unmarks a task according to its index in the list

Example of usage:

`keyword (optional arguments)`
`unmark {index}`

Expected outcome:

Description of the outcome.
Nova will acknowledge and display the unmarked task

```
expected output
Alright, this task has yet to be complete
[D][ ] eat (by: 14 July 2023 6pm)
```

### `delete` - Deletes a specific task by index

Deletes a task according to its index in the list

Example of usage:

`delete {index}`

Expected outcome:

Nova will acknowledge, delete the unmarked task and display the updated number of tasks

```
Noted. I have deleted this task
[D][ ] eat (by: 14 July 2023 6pm)
You now have 1 tasks in the list.
```


### `find` - Deletes a specific task by index

Find tasks that matches a specific keyword in your list

Example of usage:

`find {keyword}`

Expected outcome:

Nova will acknowledge, search for the related tasks and display accordingly

```
Here are the matching tasks in your list:
1.[D][ ] eat (by: 14 July 2023 6pm)
2.[T][ ] eat
```

### `bye` - Exits the application

Quits the program

Example of usage:

`bye`

Expected outcome:

Nova will greet you farewell

```
Goodbye. Hope to see u again :)
```




Binary file added ip.jar
Binary file not shown.
2 changes: 2 additions & 0 deletions nova_data/nova_inputs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[T][ ] fly
[D][ ] return book (by: Sunday)
10 changes: 0 additions & 10 deletions src/main/java/Duke.java

This file was deleted.

Binary file added src/main/java/nova/Deadline.class
Binary file not shown.
26 changes: 26 additions & 0 deletions src/main/java/nova/Deadline.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package nova;

public class Deadline extends Tasks {

protected String by;

/**
* Creates a new Deadline object
*
* @param description the description of the task
* @param by the deadline of the task
*/
public Deadline(String description, String by) {
super(description);
this.by = by;
}

/**
* Returns the string corresponding to the task icon and its deadline
*/
@Override
public String toString() {
return "[D]" + super.toString() + "(by:" + by + ")";
}

}
Binary file added src/main/java/nova/Duke.class
Binary file not shown.
Binary file added src/main/java/nova/Event.class
Binary file not shown.
28 changes: 28 additions & 0 deletions src/main/java/nova/Event.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package nova;

public class Event extends Tasks {
protected String start;
protected String end;

/**
* Creates a new Event object
*
* @param description the description of the task
* @param start the start time of the event
* @param end the end time of the event
*/
public Event(String description, String start, String end) {
super(description);
this.start = start;
this.end = end;
}

/**
* Returns the string corresponding to the task icon and the start, end time of
* the event
*/
@Override
public String toString() {
return "[E]" + super.toString() + "(" + "from: " + start + "to: " + end + ")";
}
}
76 changes: 76 additions & 0 deletions src/main/java/nova/Nova.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
package nova;

import java.io.FileNotFoundException;
import nova.exception.EmptyInputsException;
import nova.exception.ExceptionChecker;

public class Nova {

public static void main(String[] args) throws EmptyInputsException {
try {
Ui.greet_user();
Storage.checkFile();
} catch (FileNotFoundException e) {
System.out.println("File does not exist.");
}

String[] command = Parser.getCommand();

while (!"bye".equals(command[0])) {
try {
switch (command[0]) {
case "todo":
Tasklist.todo(command[1]);
break;
case "deadline":
String[] d = command[1].split("/by", 2);
String d_description = d[0];
String d_by = d[1];
ExceptionChecker.checkEmptyString(d_description);
ExceptionChecker.checkEmptyString(d_by);
Tasklist.deadline(d_description, d_by);
break;
case "event":
String[] er = command[1].split("/from|/to", 3);
String e_description = er[0];
String e_start = er[1];
String e_end = er[2];
ExceptionChecker.checkEmptyString(e_description);
ExceptionChecker.checkEmptyString(e_start);
ExceptionChecker.checkEmptyString(e_end);
Tasklist.event(e_description, e_start, e_end);
break;
case "list":
Tasklist.list();
break;
case "mark":
Integer m_index = Integer.valueOf(command[1]);
Tasklist.markTask(m_index);
break;
case "unmark":
Integer u_index = Integer.valueOf(command[1]);
Tasklist.unmarkTask(u_index);
break;
case "delete":
Integer d_index = Integer.valueOf(command[1]);
Tasklist.delete(d_index);
break;
case "find":
String keyword = command[1];
Tasklist.find(keyword);
break;
default:
System.out.println("Command not recognised. Please try again");
break;
}
} catch (ArrayIndexOutOfBoundsException e) {
System.out.println("Command is incomplete. Please try again!");
} catch (EmptyInputsException a) {
System.out.println(a.getMessage());
}
command = Parser.getCommand();
}
Ui.goodbye_user();
Tasklist.saveFile();
}
}
16 changes: 16 additions & 0 deletions src/main/java/nova/Parser.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package nova;

import java.util.Scanner;

public class Parser {
private static Scanner scan = new Scanner(System.in);
private static String input;
private static String[] command;

public static String[] getCommand() {
input = scan.nextLine();
command = input.split(" ", 2);
return command;
}

}
Loading