This site is from a past semester! The current version will be here when the new semester starts.
CS2113/T 2020 Jan-Apr
  • Full Timeline
  • Week 1 [from Mon Jan 13]
  • Week 2 [from Wed Jan 15 noon]
  • Week 3 [from Wed Jan 22 noon]
  • Week 4 [from Wed Jan 29 noon]
  • Week 5 [from Wed Feb 5 noon]
  • Week 6 [from Wed Feb 12 noon]
  • Week 7 [from Wed Feb 19 noon]
  • Week 8 [from Wed Mar 4 noon]
  • Week 9 [from Wed Mar 11 noon]
  • Week 10 [from Wed Mar 18 noon]
  • Week 11 [from Wed Mar 25 noon]
  • Week 12 [from Wed Apr 1 noon]
  • Week 13 [from Wed Apr 8 noon]
  • Textbook
  • Admin Info
  • Report Bugs
  • Forum
  • Instructors
  • Announcements
  • File Submissions
  • Tutorial Schedule
  • repl.it link
  • Java Coding Standard
  • Forum Activities Dashboard
  • Participation Dashboard

  •  Individual Project (iP):
  • Individual Project Info
  • Duke Upstream Repo
  • iP Code Dashboard
  • iP Progress Dashboard

  •  Team Project (tP):
  • Team Project Info
  • Team List
  • tP Code Dashboard
  • tP Progress Dashboard
  • iP: Week 6 iP: Week 8


    iP: Week 7

    1. Add Increment: A-MoreOOP
    2. Add Increments as PRs: Level-8, Level-9, A-JavaDoc
    3. Add a brief user guide
    4. Release the product by Monday (March 2) 1200

    1 Add Increment: A-MoreOOP

    • As in the previous week, commit, tag, and push, as you do the following increments in the master branch (no need to use separate branches).
    A-MoreOOP: Use More OOP

    A-MoreOOP

         Make the code more OOP

    Refactor the code to extract out closely related code as classes.

    • Minimal: Extract the following classes:
      • Ui: deals with interactions with the user
      • Storage: deals with loading tasks from the file and saving tasks in the file
      • Parser: deals with making sense of the user command
      • TaskList: contains the task list e.g., it has operations to add/delete tasks in the list

    For 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();
    }
    }
    • Stretch Goal: Consider extracting more classes. e.g., *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.

    2 Add Increments as PRs: Level-8, Level-9, A-JavaDoc

    • Practice using parallel git branches and PRs, as explained below:
      1. First, do each increment as a parallel branch (i.e., branch-Level-8, branch-Level-9, branch-A-JavaDoc), but do not merge any.
      2. Then, push each branch to your fork, and create a PR within your fork (i.e., from the increment branch to the master branch).
      3. Now, let's merge one of the PRs and update the remaining PRs accordingly, as given below:
        1. Merge one of the PRs on GitHub e.g., Level-8. Remember to choose the Create merge commit option when merging.
        2. Pull the updated master branch from your fork to your Computer.
        3. Note how the remaining un-merged branches are no longer in sync with the latest master. To rectify, merge the master branch to each of them. Resolve merge conflicts, if any.
        4. Push the updated branches to your fork. The PRs will update automatically to reflect the updated branch.
        5. As before, tag the merge commit in the master branch and push the tag to your fork.
      4. Merge the remaining PRs using a procedure similar to the above.
    Level-8: Dates and Times optional

    Level 8. Dates and Times

    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.

    • Minimal: Store deadline dates as a 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).
    • Stretch goal: Use dates and times in more meaningful ways. e.g., add a command to print deadlines/events occurring on a specific date.

    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

    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-JavaDoc: JavaDoc

    A-JavaDoc

         Add JavaDoc comments

    Add JavaDoc comments to the code.

    • Minimal: Add header comments to at least half of the non-private classes/methods.
    • Stretch goal: Add header comments to all non-private classes/methods, and non-trivial private methods.

    3 Add a brief user guide

    A-UserGuide: User Guide

    A-UserGuide

         Add a User Guide

    Add a User Guide to the project. Here is one simple way to do it.

    • Update the given docs\README.md. See this guide to GitHub flavored Markdown (GFMD).
    • Go to the settings page of your Duke fork and enable GitHub pages to publish from the docs folder (you can select a theme too).
    • Go to 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.

    4 Release the product by Monday (March 2) 1200

    • Create a new jar file. The jar file should be cross-platform and should work in a computer that has Java 11.
    • Do the following smoke tests to ensure the jar file works (reason: it will be used to grade your iP).
      1. Copy the jar file to an empty folder and test it from there. This should surface issues with hard-coded file paths.
      2. Pass the jar file to team members and ask them to do a test drive. Assuming some of your team members' OS differ from yours, this should verify if the app is cross-platform.
    • Create a new release on GitHub (e.g., v0.2) and upload the jar file.
    A-Release: Release

    A-Release

         Release the product

    Release the product to be used by potential users. e.g., you can make it available on GitHub


    iP: Week 6 iP: Week 8