JiaJuinPhoon - Project Portfolio

PROJECT: SHOCO

Overview

SHOCO is a desktop application used for the managing and planning of shopping lists and budget. Users interact with it through the use of a command-line interface (CLI) and the program is written in Java.

Summary of Contributions

Contributions to the User Guide

Below are sections that I have contributed to the User Guide. They showcase my ability to write documentation targeting end-users.

Adding an item: ADD

Add the specified item in the shopping list.

Format: ADD i/DESCRIPTION [p/PRICE] [q/QUANTITY]

Example of usage:

  1. ADD i/potato p/5.00 q/3 OR ADD p/5.00 q/3 i/potato
    • Add the description, price and quantity of this item in the shopping list
  2. ADD i/potato chips p/5.00 OR ADD i/potato chips q/2 OR ADD p/5.00 i/potato chips OR ADD q/5 i/potato chips
    • Add the description and price / description and quantity / of the item in the shopping list
  3. ADD i/potato chips
    • Add only description of the item in the shopping list

 


Contributions to the Developer Guide

Below are sections that I have contributed to the User Guide. They showcase my ability to write documentation targeting end-users.

 

3.1 Add feature

3.1.1 Current implementation

The add feature is implemented using an AddCommand class. This class extends from the main Command class. The user input must contain at least a description out of these parameters: description, price, quantity. User can choose not to input price or quantity as the price will set to default which is 0.0 if the user did not input any value for price. On the other hand, quantity will set to default which is 1 if the user did not input any value for quantity.

Process of object creation:

  1. Duke class receives user input from the Ui class.
  2. A Parser object is created to call its parseCommand method.
    • The Parser object instantiates an AddCommand object based on the user input.
  3. The Duke class calls the AddCommand#execute method of the AddCommand object.
  4. In the AddCommand#execute function, the item to be add is called from the ShoppingList object, using items.add().
  5. In the SD, the AddCommand will add item if the description is provided and one / both price and quantity is provided.
  6. The item object with its’ values is stored into the ShoppingList object.

The following sequence diagram below shows how the add feature works. The details of the adding item’s values are shown in a separate sequence diagram below:

alt text

alt text

3.1.2 Design considerations

Aspect: Data structure to support the add feature

Reasons for choosing Alternative 1 over alternative 2: By allowing user to just add the item without price, we can increase the flexibility. For instance, the user wants to buy milk but not sure how much does the milk cost and not sure how many milk they want to buy. So they can just add it into the list, and edit the price and quantity later when they knew the price and have decided the quantity.