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

[Ho Wei Yi Stanley] iP #99

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
d8b5029
Added Level-0: Greet.
beaniestanley Jan 27, 2021
a710370
Added Level-1: Greet, Echo, Exit
beaniestanley Jan 27, 2021
9e06de3
Debug
beaniestanley Jan 27, 2021
53e4366
Added Level-2: Add, List
beaniestanley Jan 27, 2021
f696b11
Added Level-1: Greet, Echo, Exit
beaniestanley Jan 27, 2021
0826396
Merge remote-tracking branch 'origin/master'
beaniestanley Jan 27, 2021
236e379
Add Level-3 and comply with coding standard
beaniestanley Jan 28, 2021
79b8ee9
Comply to coding standards
beaniestanley Feb 3, 2021
dee65dc
Add Level-4: ToDos, Events, Deadlines
beaniestanley Feb 3, 2021
6caaaf4
Add text files for semi-automated test
beaniestanley Feb 3, 2021
e61fbcb
Edit comment and check code quality
beaniestanley Feb 3, 2021
5007ced
Improve coding standard based on comments
beaniestanley Feb 4, 2021
9c4ca50
Edit expected output file for UI testing
beaniestanley Feb 5, 2021
d6f5511
Add error handling and improve code quality
beaniestanley Feb 11, 2021
c5a16a8
Added Class package
beaniestanley Feb 18, 2021
9eaf478
Add Class package
beaniestanley Feb 18, 2021
9d57036
Add Level-6: Delete
beaniestanley Feb 18, 2021
28bda25
Add Level-7: Save
beaniestanley Mar 5, 2021
b9e4e31
Add test file
beaniestanley Mar 5, 2021
32f8268
Merge branch 'branch-Level-7'
beaniestanley Mar 5, 2021
6c55cb6
Add Level-9: Find
beaniestanley Mar 5, 2021
a0cd9a9
Merge pull request #1 from beaniestanley/branch-Level-9
beaniestanley Mar 5, 2021
8a4f674
Add javadocs
beaniestanley Mar 5, 2021
d1f6497
Merge remote-tracking branch 'origin/master'
beaniestanley Mar 5, 2021
46d5543
Add javadocs for find method
beaniestanley Mar 5, 2021
80b1963
Debug and add UG draft
beaniestanley Mar 5, 2021
7b7abd2
Add Release v0.2 link
beaniestanley Mar 5, 2021
459f62f
Set theme jekyll-theme-cayman
beaniestanley Mar 6, 2021
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
154 changes: 144 additions & 10 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,154 @@
# User Guide

## Features
Welcome! Come and plan your tasks with Duke! :)

### Feature 1
Description of feature.
#### Types of tasks:

## Usage
1. ToDo
2. Event
3. Deadline

### `Keyword` - Describe action
* [Quick Start](#quick-Start)
* [Features](#features)
* [List all Tasks : `list`](#list-all-tasks--list)
* [Add Todo : `todo`](#add-todo--todo)
* [Add Event : `event`](#add-event--event)
* [Add Deadline : `deadline`](#add-deadline--deadline)
* [Delete Task : `delete`](#delete-task--delete)
* [Mark Task as Done : `done`](#mark-task-as-done--done)
* [Find by Keyword : `find`](#find-by-keyword--find)
* [Exit : `bye`](#exit--bye)
* [Command Summary](#command-summary)

Describe action and its outcome.
 

Example of usage:
## Quick Start

`keyword (optional arguments)`
Download `Duke.jar` from
here: https://github.com/beaniestanley/ip/releases/tag/A-Release

Expected outcome:
**Requirements:**

`outcome`
Ensure you have Java 11 or above installed.

**Usage:**

1. Store the .jar file in a folder
2. Run the .jar file
3. Enter your command!

 

## Features

### List all Tasks : `list`

Displays all the tasks currently in your task list.

> `[T]` Todo<br>
> `[E]` Event<br>
> `[D]` Deadline<br>

> `[X]` Done<br>
> `[ ]` Not done

**Format:** `list`

| | Example |
| --------- | ------------------------------------------------------- |
| Input | `list` |
| Output | `Here are the tasks in your list: ` <br>`1.[T][ ] Exercise`<br>`2.[E][X] Meet friends (at: May 22nd 5pm)`<br>`3.[D][ ] Watch lecture (by: Sunday 3pm)` |

&nbsp;

### Add ToDo : `todo`

Adds a Todo with description.<br>
**Format:** `todo <description>`

| | Example |
| --------- | ------------------------------------------------------- |
| Input | `todo eat apple` |
| Output | `Got it. I've added this task:`<br>`[T][ ] eat apple`<br>`Now you have 4 tasks in the list.` |

&nbsp;

### Add Event : `event`

Adds an event with description and datetime.<br>
**Format:** `event <description> /at <datetime>`

| | Example |
| --------- | ------------------------------------------------------- |
| Input | `Celebrate May's birthday /at 05/06/2021 1900` |
| Output | `Got it. I've added this task:`<br>`[E][ ] party (at: 05/06/2021 1900)`<br>`Now you have 5 tasks in the list.` |`

&nbsp;

### Add Deadline : `deadline`

Adds a deadline with description and datetime.<br>
**Format:** `deadline <description> /by <datetime>`

| | Example |
| --------- | ------------------------------------------------------- |
| Input | `deadline Finish iP /by Sunday 3pm` |
| Output | `Got it. I've added this task:`<br>`[D][ ] Finish iP (by: Sunday 3pm)`<br>`Now you have 6 tasks in the list.` |

&nbsp;

### Delete Task : `delete`

Deletes a task using specified index.<br>
**Format:** `delete <index> `

| | Example |
| --------- | ------------------------------------------------------- |
| Input | `delete 6` |
| Output | `Noted, I've removed this task:`<br>`[D][ ] Finish iP (by: Sunday 3pm)` |

&nbsp;

### Mark Task As Done : `done`

Marks task as done.<br>
**Format:** `done <index>`

| | Example |
| --------- | ------------------------------------------------------- |
| Input | `done 5` |
| Output | `Great job! I've marked this task as done:`<br>`[X] party` |

&nbsp;

### Find by Keyword : `find`

Displays all tasks containing the keyword.<br>
**Format:** `find <keyword>`

| | Example |
| --------- | ------------------------------------------------------- |
| Input | `find project` |
| Output | `Here are the matching tasks in your list:`<br>`1. [T][ ] do project` |

&nbsp;

### Exit : `bye`

Exits Application.<br>
**Format:** `bye`

&nbsp;

## Command summary

| Command | Format |
| --------- | ------------------------------------------------------- |
| list | `list` |
| todo | `todo <description>` |
| event | `event <description> /at <datetime>` |
| deadline | `deadline <description> /by <datetime>` |
| delete | `delete <index>` |
| done | `done <index>` |
| find | `find <keyword>` |
| bye | `bye` |
1 change: 1 addition & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
theme: jekyll-theme-cayman
26 changes: 26 additions & 0 deletions src/main/java/Classes/Deadline.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package Classes;

public class Deadline extends Task {
protected String by;

public Deadline(String description, boolean isDone, String by) {
super(description, isDone);
this.by = by;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using a more descriptive variable name that better illustrates what the variable represents.

}

/**
* @return String containing description of Deadline task
*/
@Override
public String toString() {
return "[D]" + super.toString() + "(by: " + this.by + ")";
}

/**
* @return String of formatted data to be written into the text file
*/
public String formatString() {
int done = (isDone ? 1 : 0);
return "D-" + done + "-" + description + "-" + by + "\n";
}
}
27 changes: 27 additions & 0 deletions src/main/java/Classes/Event.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package Classes;

public class Event extends Task {
protected String at;

public Event(String description, boolean isDone, String at) {
super(description, isDone);
this.at= at;
}

/**
* @return String String containing description of Event task
*/
@Override
public String toString() {
return "[E]" + super.toString() + "(at: " + this.at + ")";
}

/**
* @return String of formatted data to be written into the text file
*/
public String formatString() {
int done = (isDone ? 1 : 0);
return "E-" + done + "-" + description + "-" + at + "\n";
}
}

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

public abstract class Task {
protected String description;
protected boolean isDone;

public Task(String description) {
this.description = description;
this.isDone = false;
}

public Task(String description, boolean isDone) {
this.description = description;
this.isDone = isDone;
}

/**
* @return String with a cross sign if a Task is done, else no cross
*/
public String getStatusIcon() {
return (isDone ? "X" : " ");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though I understand what you're doing here, from a code readability standpoint, it's best to avoid conditionals in favour of a more explicit and clear if-else statement.

}

/**
* @return String with description of Task
*/
public String getDescription() {
return this.description;
}

/**
* Marks a Task as done
*/
public void markAsDone() {
this.isDone = true;
}

/**
* @return String contains whether the Task is done and its description
*/
public String toString() {
return "[" + getStatusIcon() + "] " + getDescription();
}

/**
* @return String of formatted data to be written into the text file
*/
public abstract String formatString();
}
24 changes: 24 additions & 0 deletions src/main/java/Classes/Todo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package Classes;

public class Todo extends Task {

public Todo(String description, boolean isDone) {
super(description, isDone);
}

/**
* @return String containing description of Todo task
*/
@Override
public String toString() {
return "[T]" + super.toString();
}

/**
* @return String of formatted data to be written into the text file
*/
public String formatString() {
int done = (isDone ? 1 : 0);
return "T-" + done + "-" + description + "\n";
}
}
Loading