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 Projectto close the existing project dialog first) - Set up the correct JDK version, as follows:
- Click
Configure>Structure for New Projectsand 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.javafile, right-click it, and chooseRun Duke.main(). If the setup is correct, you should see something like the below:Hello from ____ _ | _ \ _ _| | _____ | | | | | | | |/ / _ \ | |_| | |_| | < __/ |____/ \__,_|_|\_\___|
Notes about the command format:
-
Words in
UPPER_CASEare the parameters to be supplied by the user.e.g. in
todo TASK,TASKis a parameter which can be used as `todo read book'. -
Parameters must be in a certain order.
e.g. if the command
event TASK /at TIMEis written asevent /at Time TASK, it is not acceptable.
Print our the list of the schedule.
Format: list
Adds a task of type todo.
Format: todo TASK
Examples:
todo read bookAdds the taskread bookinto the schedule.
Adds a task of type event.
Format: event TASK /at TIME
Examples:
event CS2113T team meeting /at 8:30 p.m. 1st OctAdds an eventCS2113T team meetingat the time8:30 p.m. 1st Oct.event basketball matchwould not be acceptable since it lacks the/at TIMEparameter.
Adds a task of type deadline.
Format: deadline TASK /by TIME
Examples:
deadline CS2113T IP /by 2359 FriAdds a deadlineCS2113T IPby the time2359 Fri.deadline CFG resumewould not be acceptable since it lacks the/at TIMEparameter.
Deletes a task in the list.
Format: delete INDEX
Examples (suggest that there are 2 tasks in the list):
delete 1Deletes the first task in the list.delete 3would not be acceptable since the index exceeds the total number of tasks in the list.
Finds a task in the list with certain keywords.
Format: find KEYWORDS
Examples:
find bookFinds tasks with the keywordbookin the list.
Sets the state of a task to be done.
Format: done INDEX
Examples:
done 1Marks task 1 in the list as done.
Exits the program.
Format: bye
Duke automatically saves the schedule list in the document "*\data\Duke.txt". It would also read the schedule when the program is executed.
| Actions | Formats |
|---|---|
| List | list |
| Todo | todo TASK |
| Event | event TASK /at TIME |
| Deadline | deadline TASK /by TIME |
| Delete | delete INDEX |
| Find | find KEYWORDS |
| Done | done INDEX |
| Exit | bye |