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.
Prerequisites: JDK 11, update Intellij to the most recent version.
- Open Intellij (if you are not in the welcome screen, click
File
>Close Project
to close the existing project dialog first) - Set up the correct JDK version, as follows:
- Click
Configure
>Structure for New Projects
and thenProject Settings
>Project
>Project SDK
- If JDK 11 is listed in the drop down, select it. If it is not, click
New...
and select the directory where you installed JDK 11 - Click
OK
- Click
- Import the project into Intellij as follows:
- Click
Open or Import
. - Select the project directory, and click
OK
- If there are any further prompts, accept the defaults.
- Click
- After the importing is complete, locate the
src/main/java/Duke.java
file, right-click it, and chooseRun Duke.main()
. If the setup is correct, you should see something like the below:Hello from ____ _ | _ \ _ _| | _____ | | | | | | | |/ / _ \ | |_| | |_| | < __/ |____/ \__,_|_|\_\___|
The following list some of the functions that you can do with Duke
- Keep track of deadlines, events and items to do.
- Find out what is happening on a particular date
- List down all events that you have to do
- Find specific events using a certain keyword
Prerequisites: A computer running Windows, Mac OS X or Linux
- Download and copy the iPtest.jar file into an empty folder. We will assume that the folder is called "C:\Duke"
- open the command prompt by entering cmd into the search bar
- type
chcp 65001
into the command prompt and press enter - navigate to the folder
C:\Duke
in the command prompt - type
java -Dfile.encoding=UTF-8 -jar iPtest.jar
into the command prompt and press enter. - The welcome message for the program should appear.
- Download and copy the iPtest.jar file into an empty folder.
- open the terminal by clicking on
Launchpad->Utilities->Terminal
- navigate to the folder you have stored the jar file in the command prompt
- type
java -jar iPtest.jar
into the terminal and press enter. - The welcome message for the program should appear.
- Download and copy the iPtest.jar file into an empty folder.
- open the terminal in the linux distribution.
- navigate to the folder you have stored the jar file in the command prompt
- type
java -jar iPtest.jar
into the linux terminal and press enter. - The welcome message for the program should appear.
The following table shows the list of conventions used when describing each function operation
function name
- shows input that you need to type exactly in the terminal. In this case, type function name
<Compulsory User Input>
- shows input that you will need to provide your own values or words. Program will fail if information is not provided
[Optional User Input]
- shows input that you can choose to provide your own values. Input for these values are optional.
Below is a table containing the possible commands and a brief description of how to use them
Function Name | Function Description |
---|---|
bye | terminates the program and saves all recorded information into ~/data/duke.txt |
deadline | creates a deadline task with the date of deadline stored |
delete | deletes away a Task from your Task list |
done | mark a Task on your task list as done |
event | creates an event with the date of the event occurring stored |
find | prints out all events that contains a particular sequence of words |
list | prints out the list of Tasks stored on your personal list currently |
todo | creates a todo Task |
terminates the program and saves all recorded information into ~/data/duke.txt
bye
creates a deadline task with the date of deadline stored
deadline <Task name> /by <Date> [time]
<Task name>
- Name of the task that has a deadline. E.g. Homework
<Date>
- A date in the form yyyy:mm:dd where the deadline will be set. E.g. 2020-03-09
[Time]
- Optional Time information containing the time when the deadline must be met. If no time provided, assume that time of deadline is set to 12 midnight.
deadline Homework /by 2020-04-03 13:00
- creates a deadline task called "Homework" that has a deadline set on 03 April 2020 at 1pm
deadline Homework /by 1998-02-03
- creates a deadline task called "Homework" that has a deadline set on 03 February 1998 at 12 midnight.
deletes away a Task from your Task list
delete <index>
<index>
- a number matching the index number of the item to be deleted from the list
delete 3
- deletes the Task with index number 3 from your list of Tasks
Mark a Task on your task list as done
done <index>
<index>
- a number matching the index number of the item to be marked as done
done 2
- marks the Task with index number 2 from your list as completed
Creates an event with the date of the event occurring stored
event <Task name> /at <Date> [time]
<Task name>
- Name of the Event. E.g. Christmas 2020
<Date>
- A date in the form yyyy:mm:dd when the event will occur. E.g. 2020-03-09
[Time]
- Optional Time information containing the time when the event will occur. If no time provided, assume that time of event occurring is set to 12 midnight.
event Christmas /by 2020-12-25 13:00
- creates an event task called "Christmas" that occurs on 25 December 2020 at 1pm
event Birthday /by 1998-02-03
- creates an event task called "Birthday" that occurs on 03 February 1998 at 12 midnight.
prints out all events that contains a particular sequence of words
find <Word Sequence>
<Word Sequence>
- Sequence of words user enters. Program will present all Task entries containing those sequence of words.
Assuming you have the following items in your list, shown below in this table:
Index No. | Event Type | Status | Name of Task | date |
---|---|---|---|---|
1 | Todo | Not Done | Homework | N.A. |
2 | Deadline | Done | Cook Dinner | 2010-03-01 12:30 |
3 | Event | Not Done | Hari Raya Puasa | 2021-05-12 00:00 |
4 | Event | Not Done | Party | 2010-03-01 14:15 |
find Cook
- will list out all events with the word "Cook" as shown below
Here are the list of activities that contain the word "Cook":
2.[D][✓] Cook Dinner (by: 2010-03-01 12:30)Session saved!
prints out the list of Tasks stored on your personal list currently
list [Date]
[Date]
- Optional Date information in the form yyyy-mm-dd. If provided, cause the program to list down all events and deadlines that occur on that date.
Assuming you have the following items in your list, shown below in this table:
Index No. | Event Type | Status | Name of Task | date |
---|---|---|---|---|
1 | Todo | Not Done | Homework | N.A. |
2 | Deadline | Done | Cook Dinner | 2010-03-01 12:30 |
3 | Event | Not Done | Hari Raya Puasa | 2021-05-12 00:00 |
4 | Event | Not Done | Party | 2010-03-01 14:15 |
list
- will list out all the events on the screen in the following format
Here are the tasks in your list:
1.[T][✗] Homework
2.[D][✗] Cook Dinner (by: 01 Mar 2010 12:30:00 p.m)
3.[E][✗] Hari Raya Puasa (at: 12 May 2021 12:00:00 a.m)
4.[E][✗] Party (at: 01 Mar 2010 02:15:00 p.m)
list 2010-03-01
- will list out all the events on the screen that falls on the 01 March 2010 in the following format
Here are all the activities that are conducted on this date: 2010-03-01
2.[D][✗] Cook Dinner (by: 01 Mar 2010 12:30:00 p.m)
4.[E][✗] Party (at: 01 Mar 2010 02:15:00 p.m)
creates a todo Task
todo <Task Name>
<Task Name>
- name of the todo task. E.g. Eat dinner.
todo Eat dinner
- creates a todo task with the name "Eat dinner" and adds it to the list