repl.it
linkiP:
A-MoreOOP
Level-8
, Level-9
, A-JavaDoc
tP:
A-MoreOOP
master
branch (no need to use separate branches).A-MoreOOP
: Use More OOP Refactor the code to extract out closely related code as classes.
Ui
: deals with interactions with the userStorage
: deals with loading tasks from the file and saving tasks in the fileParser
: deals with making sense of the user commandTaskList
: contains the task list e.g., it has operations to add/delete tasks in the listFor example, the code of the main class could look like this:
public class Duke {
private Storage storage;
private TaskList tasks;
private Ui ui;
public Duke(String filePath) {
ui = new Ui();
storage = new Storage(filePath);
try {
tasks = new TaskList(storage.load());
} catch (DukeException e) {
ui.showLoadingError();
tasks = new TaskList();
}
}
public void run() {
//...
}
public static void main(String[] args) {
new Duke("data/tasks.txt").run();
}
}
*Command
classes (i.e., AddCommand
, DeleteCommand
, ExitCommand
etc.) that inherits from an abstract Command
class, so that you can write the main logic of the App as follows:
public void run() {
ui.showWelcome();
boolean isExit = false;
while (!isExit) {
try {
String fullCommand = ui.readCommand();
ui.showLine(); // show the divider line ("_______")
Command c = Parser.parse(fullCommand);
c.execute(tasks, ui, storage);
isExit = c.isExit();
} catch (DukeException e) {
ui.showError(e.getMessage());
} finally {
ui.showLine();
}
}
}
You can get some inspiration from how the code of the addressbook-level2 is organized.Level-8
, Level-9
, A-JavaDoc
branch-Level-8
, branch-Level-9
, branch-A-JavaDoc
), but do not merge any.master
branch).Create merge commit
option when merging.master
branch from your fork to your Computer.master
. To rectify, merge the master
branch to each of them. Resolve merge conflicts, if any.Level-8
: Dates and Times optional
Teach Duke to understand dates and times. For example, if the command is deadline return book /by 2/12/2019 1800
, Duke understands 2/12/2019 1800
as 2nd of December 2019, 6pm, instead of storing it simply as a String.
java.time.LocalDate
in your task objects. Accept dates in a format such as yyyy-mm-dd
format (e.g., 2019-10-15
) and print in a different format such as MMM dd yyyy
e.g., (Oct 15 2019
).Using dates/times in Java
A code snippet using the LocalDate
class:
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
public class Main {
public static void main(String[] args) {
//create dates from strings
LocalDate d1 = LocalDate.parse("2019-12-01");
LocalDate d2 = LocalDate.parse("2019-12-02");
LocalDate d3 = LocalDate.parse("2019-12-02");
//compare dates
System.out.println(d1.isBefore(d2)); // -> true
System.out.println(d1.isAfter(d2)); // -> false
System.out.println(d2.equals(d3)); // -> true
//work with dates
System.out.println(d1.getDayOfWeek()); // -> SUNDAY
System.out.println(d1.getMonth()); // -> DECEMBER
System.out.println(d1.plus(1, ChronoUnit.YEARS)); // -> 2020-12-01
// get today's date and print it in a specific format
LocalDate d4 = LocalDate.now();
System.out.println(d4); // -> 2019-10-15
System.out.println(d4.format(DateTimeFormatter.ofPattern("MMM d yyyy"))); // -> Oct 15 2019
}
}
Level-9
: Find
Give users a way to find a task by searching for a keyword.
Example:
find book
____________________________________________________________
Here are the matching tasks in your list:
1.[T][✓] read book
2.[D][✓] return book (by: June 6th)
____________________________________________________________
A-UserGuide
: User Guide Add a User Guide to the project. Here is one simple way to do it.
docs\README.md
. See this guide to GitHub flavored Markdown (GFMD).docs
folder (you can select a theme too).http://{your username}.github.io/duke/
to view the user guide of your product. Note: it could take 5-10 minutes for GitHub to update the page.v0.2
) and upload the jar file.Admin Appendix E(extract): Organization setup
Please follow the organization/repo name format precisely because we use scripts to download your code or else our scripts will not be able to detect your work.
After receiving your team ID, one team member should do the following steps:
AY1920S2-TEAM_ID
. e.g. AY1920S2-CS2113T-W12-1
, AY1920S2-CS2113-F09-3
developers
to your organization.Admin Appendix E(extract): Repo setup
The tP project template given to you is a variation of the Duke repo you used for the iP, but with some important differences. Please follow instructions carefully, rather than follow what you remember from the iP.
Only one team member:
GitHub Pages
for the master branch /docs folder
(similar to how you did it in the iP).github.io
URL.master
branch to [nus-cs2113-AY1920S2/tP] master
branch. PR name: [Team ID] Product Name
e.g., [CS2113T-T09-2] Contact List Pro
. As you merge code to your team repo's master
branch, this PR will auto-update to reflect how much your team's product has progressed. In the PR description use @githubUserName@mention the other team members so that they get notified when the tutor adds comments to the PR.All team members:
tP
repo (created above) i.e., go to the repo and click on the button to subscribe to activities of the repotP
repo to your personal GitHub account.Note that some of our bot scripts depend on the following folder paths. Please do not alter those paths in your project.
/src/main/java
/src/test/java
/docs
Decide which part of v1.0 each member will implement. Break those into smaller tasks (i.e., small enough for one person to complete within a week).
Reflect the above plan in the issue tracker by creating issues to represent those tasks and assigning the corresponding issues (create new issues if necessary) to yourself and to the corresponding milestone.