Git Product home page Git Product logo

ip's People

Contributors

damithc avatar ianyong avatar j-lum avatar jiachen247 avatar

ip's Issues

Level 7: Save

Save the tasks in the hard disk automatically whenever the task list changes. Load the data from the hard disk when Duke starts up. You may hard-code the file name and location e.g., [project_root]/data/duke.txt

The format of the file is up to you. Example:

T | 1 | read book
D | 0 | return book | June 6th
E | 0 | project meeting | Aug 6th 2-4pm
T | 1 | join sports club

If you use file paths in your code,

  • remember to use relative paths rather than absolute paths such as C:\data. If not, your app can cause unpredictable results when used in another computer.
  • remember to specify file paths in an OS-independent way. If not, your app might not work when used on a different OS.

Your code must handle the case where the file doesn't exist at the start. Reason: when someone else takes your Duke and runs it for the first time, the required file might not exist in their computer. Similarly, if you expect the data file to be in as specific folder (e.g., ./data/), you must also handle the 'folder does not exist yet' case.

Refer to https://nus-cs2103-ay2021s1.github.io/website/schedule/week3/project.html#level-7-save.

A-Gradle: Use Gradle

  • A-Gradle: Automate project builds using Gradle

Use Gradle to automate some of the build tasks of the project.

Refer to the Gradle tutorial @SE-EDU to learn how to use Gradle.

Gradle support is provided as a separate branch (named add-gradle-support) in the Duke repo. Therefore, you can follow the scenario 2 in the above guide.

  • Minimal: Set up gradle so that you can build and run Duke using gradle.
  • Recommended: Set up gradle to run unit tests.
  • Stretch Goal: Use gradle to automate more things in your project.

Refer to https://nus-cs2103-ay2021s1.github.io/website/schedule/week4/project.html#a-gradle.

Level 1: Greet, Echo, Exit

Implement a skeletal version of Duke that starts by greeting the user, simply echos commands entered by the user, and exits when the user types bye.

Example:

    ____________________________________________________________
     Hello! I'm Duke
     What can I do for you?
    ____________________________________________________________

list
    ____________________________________________________________
     list
    ____________________________________________________________

blah
    ____________________________________________________________
     blah
    ____________________________________________________________

bye
    ____________________________________________________________
     Bye. Hope to see you again soon!
    ____________________________________________________________
  • The indentation and horizontal lines are optional.

Refer to https://nus-cs2103-ay2021s1.github.io/website/schedule/week2/project.html#level-1-greet-echo-exit.

Level 2: Add, List

Add the ability to store whatever text entered by the user and display them back to the user when requested.

Example:

    ____________________________________________________________
     Hello! I'm Duke
     What can I do for you?
    ____________________________________________________________

read book
    ____________________________________________________________
     added: read book
    ____________________________________________________________

return book
    ____________________________________________________________
     added: return book
    ____________________________________________________________

list
    ____________________________________________________________
     1. read book
     2. return book
    ____________________________________________________________
bye
    ____________________________________________________________
     Bye. Hope to see you again soon!
    ____________________________________________________________

  • There is no need to save the data to the hard disk.
  • Assume there will be no more than 100 tasks. If you wish, you may use a fixed size array (e.g., String[100]) to store the items.

Refer to https://nus-cs2103-ay2021s1.github.io/website/schedule/week2/project.html#level-2-add-list.

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/{repo name}/ to view the user guide of your product. Note: it could take 5-10 minutes for GitHub to update the page.

Refer to https://nus-cs2103-ay2021s1.github.io/website/schedule/week6/project.html#a-userguide.

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.

Refer to https://nus-cs2103-ay2021s1.github.io/website/schedule/week3/project.html#a-moreoop.

Level 8: Dates and Times

Teach Duke how to understand dates and times. For example, if the command is deadline return book /by 2/12/2019 1800, Duke should understand 2/12/2019 1800 as 2nd of December 2019, 6pm, instead of treating it as just 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.

Refer to https://nus-cs2103-ay2021s1.github.io/website/schedule/week3/project.html#level-8-dates-and-times.

BCD-Extension: Add an extension

  • Add at least one extension of your choice, selected from category B, C, or D i.e., pick just one item from one category e.g., B-DoWithinPeriodTasks or C-Sort or D-Places
  • Recommended to add the extension via a branch (branch name is up to you). Optional to add it via a PR.
  • Add a tag named BCD-Extension to the corresponding commit.

Discuss with your team members to ensure that each member picks a different extension.

You may want to pick an extension that is relevant to your tP so that the code can be reused in the tP later.

Refer to https://nus-cs2103-ay2021s1.github.io/website/schedule/week5/project.html#4-add-an-extension.

Level 4: ToDos, Events, Deadlines

Add support for tracking three types of tasks:

  1. ToDos: tasks without any date/time attached to it e.g., visit new theme park
  2. Deadlines: tasks that need to be done before a specific date/time e.g., submit report by 11/10/2019 5pm
  3. Events: tasks that start at a specific time and ends at a specific time e.g., team project meeting on 2/10/2019 2-4pm

Example:

todo borrow book
    ____________________________________________________________
     Got it. I've added this task: 
       [T][✗] borrow book
     Now you have 5 tasks in the list.
    ____________________________________________________________

list
    ____________________________________________________________
     Here are the tasks in your list:
     1.[T][✓] read book
     2.[D][✗] return book (by: June 6th)
     3.[E][✗] project meeting (at: Aug 6th 2-4pm)
     4.[T][✓] join sports club
     5.[T][✗] borrow book
    ____________________________________________________________

deadline return book /by Sunday
    ____________________________________________________________
     Got it. I've added this task: 
       [D][✗] return book (by: Sunday)
     Now you have 6 tasks in the list.
    ____________________________________________________________

event project meeting /at Mon 2-4pm
    ____________________________________________________________
     Got it. I've added this task: 
       [E][✗] project meeting (at: Mon 2-4pm)
     Now you have 7 tasks in the list.
    ____________________________________________________________

At this point, dates/times can be treated as strings; there is no need to convert them to actual dates/times.

Example:

deadline do homework /by no idea :-p
    ____________________________________________________________
     Got it. I've added this task: 
       [D][✗] do homework (by: no idea :-p)
     Now you have 6 tasks in the list.
    ____________________________________________________________

When implementing this feature, you are also recommended to implement the following extension:

  • A-Inheritance: Use Inheritance to support multiple task types
    • As there are multiple types of tasks that have some similarity between them, you can implement classes Todo, Deadline and Event classes to inherit from a Task class.
      Furthermore, use polymorphism to store all tasks in a data structure containing Task objects e.g., Task[100].

Refer to https://nus-cs2103-ay2021s1.github.io/website/schedule/week2/project.html#level-4-todos-events-deadlines.

Level 3: Mark as Done

Add the ability to mark tasks as done.

Example:

list
    ____________________________________________________________
     Here are the tasks in your list:
     1.[✓] read book
     2.[✗] return book
     3.[✗] buy bread
    ____________________________________________________________

done 2
    ____________________________________________________________
     Nice! I've marked this task as done: 
       [✓] return book
    ____________________________________________________________

When implementing this feature, you are also recommended to implement the following extension:

  • A-Classes: Use a class to represent tasks
    • While it is possible to represent a task list as a multi-dimensional array containing primitive values, the more natural approach is to use a Task class to represent tasks.

Refer to https://nus-cs2103-ay2021s1.github.io/website/schedule/week2/project.html#level-3-mark-as-done.

Level 6: Delete

Add support for deleting tasks from the list.

Example:

list
    ____________________________________________________________
     Here are the tasks in your list:
     1.[T][✓] read book
     2.[D][✓] return book (by: June 6th)
     3.[E][✗] project meeting (at: Aug 6th 2-4pm)
     4.[T][✓] join sports club
     5.[T][✗] borrow book
    ____________________________________________________________

delete 3
    ____________________________________________________________
     Noted. I've removed this task: 
       [E][✗] project meeting (at: Aug 6th 2-4pm)
     Now you have 4 tasks in the list.
    ____________________________________________________________

When implementing this feature, you are also recommended to implement the following extension:

  • A-Collections: Use Java Collections classes
    • Use Java Collections classes for storing data. For example, you can use an ArrayList<Task> to store the tasks.

Refer to https://nus-cs2103-ay2021s1.github.io/website/schedule/week2/project.html#level-6-delete.

A-BetterGui: Better GUI

  • A-BetterGui: Improve the GUI

Improve the GUI to make it more polished. Some examples:

  • Tweak the GUI to match the asymmetric nature of the conversation: As the conversation is between the user and the app (not between two humans), it is asymmetric in nature. Accordingly, it makes sense not to display both sides of the conversion in the same visual format.
  • Highlight errors e.g., when the user types a wrong command, the error should be shown in a different format to catch ther user's attention.
  • Tweak padding, fonts, colors, alignments to make the GUI more pleasing to look at.
  • Profile pictures: If your GUI shows profile pictures, you can tweak the way the picture is shown (e.g., crop as a circle or a square with rounded corners). In fact, an easy tweak is to use a picture with a transparent background so that it blends nicely with the background.

You can take inspiration from these past projects. If you adopt any ideas from them, don't forget to give credit to the original author.

Refer to https://nus-cs2103-ay2021s1.github.io/website/schedule/week6/project.html#a-bettergui.

Level 5: Handle Errors

Teach Duke to deal with errors such as incorrect inputs entered by the user.

Example:

todo
    ____________________________________________________________
     ☹ OOPS!!! The description of a todo cannot be empty.
    ____________________________________________________________

blah
    ____________________________________________________________
     ☹ OOPS!!! I'm sorry, but I don't know what that means :-(
    ____________________________________________________________

When implementing this feature, you are also recommended to implement the following extension:

  • A-Exceptions: Use Exceptions to handle errors
    • Use exceptions to handle errors. For example, define a class DukeException to represent exceptions specific to Duke.
    • Minimal: handle at least the two types of errors shown in the example above.
    • Stretch goal: handle all possible errors in the current version. As you evolve Duke, continue to handle errors related to the new features added.

Refer to https://nus-cs2103-ay2021s1.github.io/website/schedule/week2/project.html#level-5-handle-errors.

A-Jar: Create a JAR File

  • A-Jar: Package the App as a JAR file

Package the app as an executable JAR file so that it can be distributed easily.

You can assume the user will run the jar file in the following way only:

  • Copy the jar file into an empty folder
  • Open a command window in that folder
  • Run the command java -jar {filename}.jar e.g., java -jar Duke.jar (i.e., run the command in the same folder as the jar file)

Refer to the tutorial Working with JAR files @SE-EDU/guides to find how to create JAR files.

Do not commit the JAR file created. Instead, you can make the JAR file available in the following manner.

  • Go to your fork on GitHub and create a new release.
  • In the page where you fill the details of th release,
    • give an appropriate version number e.g., v0.1
    • attach the JAR file where it says Attach binaries by dropping them ....

Refer to https://nus-cs2103-ay2021s1.github.io/website/schedule/week3/project.html#a-jar.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.