Skip to content

Commit

Permalink
Merge pull request #255 from akhilvuputuri/updateUGdiet
Browse files Browse the repository at this point in the history
Update UG and sample data set
  • Loading branch information
sheexiong authored Apr 2, 2020
2 parents 699776b + c68399b commit eda75d2
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 24 deletions.
114 changes: 100 additions & 14 deletions docs/UserGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ Allows users to decide which dieting mode they want, based on the following mode
* Gain Weight (-g)
* Maintain (-m)

Format: `diet mode [-m] [-l] [-g]` +
Example: `diet mode -m`
Format: `mode [-m] [-l] [-g]` +
Example: `mode -m`

==== Store Height `height`
Allows user to input their height.
Expand All @@ -153,21 +153,32 @@ NOTE: Weight in kilograms (kg)
==== Add food `add`
Adds food to the list.

****
* Adds food item with the given name, calories and tags.
* Name and Calories are compulsory.
* Tags are optional.
****

Format: `add food CALORIES` +
Example: `add Fishball Noodles 383`

==== List items `list`
List food in your current diet tracker. Show different data based on flags.
List food in your current diet tracker along with the total calorie count.
Watch your diet intake for different time frames and food of different categories.

Displays different data based on the below flags:

****
* Food consumed for the day (NO FLAG)
* All food ever consumed (-a)
* Food consumed for the past number of days (-d)
* All food with the given tag (-t)
****

NOTE: Default value of list is food consumed for the day.

Format: `list [-f] [-d] [-t [numDays]] [-e [tagName]] ` +
Example: `list -t 3`
Format: `list [-a] [-d NUMDAYS] [-t TAGNAME]` +
Example: `list`, `list -a`, `list -d 3`, `list -t healthy` ,

==== Delete Food Item `delete`

Expand Down Expand Up @@ -207,15 +218,6 @@ Example:
* `edit 2 -n Chicken Rice -c 585` +
Edits the name of the food item at index 2 to be 'Chicken Rice' and the calories to be '585'.

==== Calculate Daily Calories `calc`

Calculates and lists the following: +

* Total Calorie Intake for the day.
* Calories left based on your preferred dieting mode.

Format: `calc`

==== Calculate Body Mass Index (BMI) `bmi`

Allows the user to calculate their BMI based on the height and weight stored in the program. +
Expand Down Expand Up @@ -410,6 +412,90 @@ If you would like to know more about a specific command, you can view more infor

=== For Diet Tracker

* *Add Food* `add` +
e.g `add -n salad -c 235 -t healthy`

* *Delete Food* `delete` +
e.g `delete 3`

* *Edit Food* `edit` +
e.g `edit 2 -n chips -c 230`

* *List Food* `list [-a] [-d numDays] [-t tagName]` +
e.g `list`

* *Set Mode* `mode MODE` +
e.g. `back`

* *Set Height* : `height HEIGHT` +
e.g. `height 169`

* *Set Weight* `weight WEIGHT` +
e.g. `weight 56`

* *Calculate BMI* `bmi` +
e.g. `bmi -h 172 -w 65.5`

* *Back* `back` +
e.g. `back`

|===
|Command |Format |Example

|<<add, *Add Food*>>
|`add -f FOODNAME -c CALORIES -t TAGS`
|`insert -f salad -c 235` +
`insert -f fries -c 195 -t fastfood`

|<<delete, *Delete Food*>>
|`delete INDEX`
|`delete 1` +
`delete 2`

|<<edit, *Edit Food*>>
|`edit INDEX [-n NAME] [-c CALORIES]`
|`edit 1 -n carbonara -c 543` +
`edit 2 -n chips -c 230`

|<<list, *List Food*>>
|`list [-a] [-d NUMDAYS] [-t TAGNAME]`
|`list` +
`list -a` +
`list -d 6` +
`list-t healthy`

|<<mode, *Set Mode*>>
|`mode MODE`
|`mode -l` +
`mode -g` +
`mode -h`

|<<height, *Set Height*>>
|`height HEIGHT`
|`delete 1` +
`delete 2`

|<<weight, *Set Weight*>>
|`weight WEIGHT`
|`delete 1` +
`delete 2`

|<<bmi, *Calculate BMI*>>
|`bmi [-h HEIGHT] [-w WEIGHT]`
|`bmi` +
`bmi -h 172 -w 65.5`


|<<exit, *Exit*>>
|`exit`
|`exit`


|<<help, *Help*>>
|`help`
|`help`

|===

=== For Expense Splitter

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ public class HelpCommand extends Command {
+ " USAGE: edit -i INDEX [-n NAME] [-c CALORIES]\n"
+ " EXAMPLE: edit -i 1 -n Prawn Aglio -c 520\n"
+ DIVIDER
+ "4. list - Use this to list the food for a given period of time specified by the tags.\n"
+ " USAGE: list [-f] [-d] [-t [NUMDAYS]]\n"
+ " EXAMPLE: list -f\n"
+ "4. list - Use this to list the food for a given period of time or food of a certain tag.\n"
+ " USAGE: list [-a] [-d NUMDAYS] [-t TAG]\n"
+ " EXAMPLE: list -a\n"
+ DIVIDER
+ "5. mode - Use this to change the mode (GAIN, MAINTAIN, LOSS) of the Diet Tracker.\n"
+ " USAGE: mode [-g] [-l] [-m]\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,30 @@
import seedu.eylah.diettracker.model.FoodBook;
import seedu.eylah.diettracker.model.ReadOnlyFoodBook;
import seedu.eylah.diettracker.model.food.Calories;
import seedu.eylah.diettracker.model.food.Date;
import seedu.eylah.diettracker.model.food.Food;
import seedu.eylah.diettracker.model.food.Name;
import seedu.eylah.diettracker.model.tag.Tag;

/**
* Contains utility methods for populating {@code AddressBook} with sample data.
* Contains utility methods for populating {@code FoodBook} with sample data.
*/
public class SampleDataUtil {

public static Food[] getSampleFoods() {
return new Food[] {
new Food(new Name("Burger"), new Calories(290), getTagSet("fastfood")),
new Food(new Name("Fries"), new Calories(120), getTagSet("fastfood")),
new Food(new Name("Coke"), new Calories(150), getTagSet("fastfood", "drinks")),
new Food(new Name("Hotdog"), new Calories(230), getTagSet("fastfood")),
new Food(new Name("Spaghetti"), new Calories(450), getTagSet("italian")),
new Food(new Name("Sandwich"), new Calories(300), getTagSet("healthy"))
new Food(new Name("Burger"), new Calories(290), new Date("2020-02-24T02:50:22.279828"),
getTagSet("fastfood")),
new Food(new Name("Fries"), new Calories(120), new Date("2020-03-15T02:50:22.279828"),
getTagSet("fastfood")),
new Food(new Name("Coke"), new Calories(150), new Date("2020-03-20T02:50:22.279828"),
getTagSet("fastfood", "drinks")),
new Food(new Name("Hotdog"), new Calories(230), new Date("2020-03-30T02:50:22.279828"),
getTagSet("fastfood")),
new Food(new Name("Spaghetti"), new Calories(450), new Date("2020-04-01T02:50:22.279828"),
getTagSet("italian")),
new Food(new Name("Sandwich"), new Calories(300), new Date("2020-04-02T02:50:22.279828"),
getTagSet("healthy"))
};
}

Expand Down

0 comments on commit eda75d2

Please sign in to comment.