DietBook is a desktop application, optimized for use via a Command Line Interface (CLI). It is designed to track your food and nutritional intake as well as provide you with your daily calorie recommendation. As the application mainly targets NUS students staying on campus, it has a database prepopulated with food items commonly found around NUS. This allows for such food items to be easily added to the list of food items consumed for tracking.
add
list
list
list yyyy-mm-ddTHH:mm
delete INDEX
dietbook.jar
from here.java -jar dietbook.jar
.Please take note of the following:
Words in UPPER_CASE
are parameters to be supplied by the user.
e.g. For name YOUR_NAME_OR_NICKNAME
, name Jack
would be a valid command.
Parameters in square brackets are optional. However, if all parameters are optional, at least one parameter needs to be given. In such cases, any one of the parameters would be valid.
e.g. For editinfo [n/NAME] [g/GENDER] [a/AGE] [h/HEIGHT] [o/ORIGINAL_WEIGHT] [c/CURRENT_WEIGHT] [t/TARGET_WEIGHT] [f/FITNESS_LEVEL]
, editinfo a/31
and editinfo h/173 o/87
are valid commands but editinfo
is not.
For commands with multiple parameters, the parameters can be in any order only if the parameters are attached to a parameter tag like n/
, a/
, etc. Otherwise, they must be entered in the sequence as shown in this guide, the Help Command or the Summary Command.
e.g. For calculate NUTRIENT_TYPE [yyyy-mm-ddTHH:mm] [yyyy-mm-ddTHH:mm]
,calculate fat 2020-07-03T23:59 2020-09-03T23:59
is valid but calculate 2020-07-03T23:59 fat 2020-09-03T23:59
is not.
e.g. For add i/INDEX x/PORTION_SIZE [yyyy-mm-ddTHH:mm]
, add x/1 i/1 2020-09-03T23:59
is valid but add i/1 2020-09-03T23:59 x/1
is not as time needs to be entered as the last parameter.
Command words and parameter indicators are case-sensitive.
e.g. help
is a valid command but Help
is not.
e.g. For add i/INDEX x/PORTION_SIZE [yyyy-mm-ddTHH:mm]
, add i/1 x/1 2020-07-03T23:59
is valid but add I/1 x/1 2020-07-03T23:59
is not.
Spacing to separate command word and parameters is required.
e.g. For calculate NUTRIENT_TYPE
, calculate all
is valid but calculateall
is not.
Inappropriate usage of /
, the forward slash, may lead to invalid commands. Only use one /
in parameter tags like n/
, a/
, etc and avoid using /
otherwise.
name
Stores the user’s name or nickname into DietBook during the initial setup.
Format: name YOUR_NAME_OR_NICKNAME
/
, the forward slash.
/
.Example of usage:
name Jack
Output example:
Hi Jack!
Before we get started, I would like to know about about you so that I can make more
accurate calculations for you :). Therefore, could you please share with me the following:
- Your gender either F for female or M for male or O for others.
- Your age which is a positive integer.
- Your height in cm.
- Your original weight in kg, the weight when you first started using DietBook or you current weight.
- Your current weight in kg.
- Your target weight in kg, or your current weight if that is also your target weight.
- Your fitness level, represented by a number from 1 to 5.
1 = You hardly engage in any exercise or have a job that requires little to no physical activity.
2 = You engage in some form of light exercise or have a job that requires some physical activity.
3 = You engage in moderate amount of exercise or have a job that requires moderate physical activity.
4 = You engage in vigorous exercise or have a physically demanding job.
5 = You engage in extremely vigorous exercise or have an extremely physically demanding job.
Please input your details in the following format:
info g/GENDER a/AGE h/HEIGHT o/ORIGINAL_WEIGHT c/CURRENT_WEIGHT t/TARGET_WEIGHT f/FITNESS_LEVEL
Example: info g/F a/21 h/165 o/65 c/65 t/55 f/2
info
Stores the user’s personal information into DietBook during the initial setup.
Format: info g/GENDER a/AGE h/HEIGHT o/ORIGINAL_WEIGHT c/CURRENT_WEIGHT t/TARGET_WEIGHT f/FITNESS_LEVEL
M
for male, F
for female or O
for others.Example of usage:
info g/M a/21 h/175 o/85 c/85 t/75 f/2
stores the user’s gender, age, height, original, current and target weight as well as the fitness level to male
, 21
, 175
, 85
, 85
, 75
and You engage in some form of light exercise or have a job that requires some physical activity.
respectively.Output example:
Thank you! DietBook has been initialised and you may start by entering any valid commands.
If you require a list of valid commands, you can enter: help
userinfo
Shows the user information stored in DietBook.
Format: userinfo
Output example:
Here is your information:
Name: Jack
Gender: male
Age: 21
Height: 175cm
Original weight: 85kg
Current weight: 85kg
Target weight: 75kg
Fitness level: You engage in some form of light exercise or have a job that requires some physical activity.
editinfo
Edits the user information stored in DietBook.
Format: editinfo [n/NAME] [g/GENDER] [a/AGE] [h/HEIGHT] [o/ORIGINAL_WEIGHT] [c/CURRENT_WEIGHT] [t/TARGET_WEIGHT] [f/FITNESS_LEVEL]
/
, the forward slash.
/
.M
for male, F
for female or O
for others.Example of usage:
editinfo c/75 f/4
and editinfo f/4 c/75
edits the current weight and fitness level of the user to be 75
and You engage in vigorous exercise or have a physically demanding job.
respectively.Output example:
Got it! I've updated your personal information:
Name: Jack
Gender: male
Age: 21
Height: 175cm
Original weight: 85kg
Current weight: 75kg
Target weight: 75kg
Fitness level: You engage in vigorous exercise or have a physically demanding job.
data
Displays a list of provided food database.
Format: data
Output example:
Here are the food items in the database:
1. Prawn Mee Soup(Dry)(Large) | calorie : 490 | protein : 20 | carbohydrate : 30 | fats : 26
2. Prawn Mee Soup(Dry)(Small) | calorie : 390 | protein : 15 | carbohydrate : 25 | fats : 19
3. Fried Hokkien Prawn Mee(Large) | calorie : 470 | protein : 20 | carbohydrate : 40 | fats : 20
4. Fried Hokkien Prawn Mee(Small) | calorie : 350 | protein : 15 | carbohydrate : 30 | fats : 15
5. Clay Pot Chicken | calorie : 440 | protein : 15 | carbohydrate : 34 | fats : 15
6. Black Pepper Chicken | calorie : 490 | protein : 16 | carbohydrate : 34 | fats : 16
7. Ayam Penyet Set | calorie : 699 | protein : 30 | carbohydrate : 45 | fats : 30
8. Steamed Chicken Set | calorie : 475 | protein : 20 | carbohydrate : 35 | fats : 20
9. Ikan Grouper Penyet Set | calorie : 669 | protein : 40 | carbohydrate : 50 | fats : 50
10. kimchi fried rice | calorie : 520 | protein : 35 | carbohydrate : 45 | fats : 56
11. ginseng chicken | calorie : 450 | protein : 32 | carbohydrate : 25 | fats : 66
12. ramen | calorie : 530 | protein : 25 | carbohydrate : 76 | fats : 43
13. gong cha green tea | calorie : 100 | protein : 0 | carbohydrate : 0 | fats : 0
14. gong cha ooloong tea | calorie : 100 | protein : 0 | carbohydrate : 0 | fats : 0
15. gong cha bubble tea | calorie : 200 | protein : 0 | carbohydrate : 0 | fats : 0
add
Adds a desired food in the database into the DietBook.
Format: add i/FOOD_INDEX x/PORTION_SIZE [yyyy-mm-ddTHH:MM]
Note : optional date time input, if not provided, the entry will have the current date time stamp Inputting a future date time is not allowed.
Example of Usage:
add i/1 x/1
adds the food in the data base with index 1 with a portion of 1 at the current timeadd i/3 x/2 2020-11-02T12:30
adds the food with index 3 with a portion of 2 at date and time 2 nov 2020 12:30Output example:
1. Prawn Mee Soup(Dry)(Large) | calorie : 490 | protein : 20 | carbohydrate : 30 | fats : 26 -- (1) [09 Nov 2020 2238]
2. Fried Hokkien Prawn Mee(Large) | calorie : 470 | protein : 20 | carbohydrate : 40 | fats : 20 -- (2) [02 Nov 2020 1230]
add
Format: add x/PORTION_SIZE n/FOOD_NAME k/CALORIE [c/CARBOHYDRATE] [p/PROTEIN] [f/FAT]
Examples of usage :
add x/1 n/Salty Chicken Rice k/300 c/10 p/20 f/50
Got it! I've added this food item:
Salty Chicken Rice | calorie : 300 | protein : 20 | carbohydrate : 10 | fats : 50 -- (1)
add x/2 n/Chilli Pepper Crab k/400 c/10 p/10 f/20
Got it! I've added this food item:
Chilli Pepper Crab | calorie : 400 | protein : 10 | carbohydrate : 10 | fats : 20 -- (2)
list
Example of usage : list
Output :
Here are the food items in DietBook:
1. Salty Chicken Rice | calorie : 300 | protein : 20 | carbohydrate : 10 | fats : 50 -- (1)
2. Salty Chicken Rice | calorie : 300 | protein : 20 | carbohydrate : 10 | fats : 50 -- (1)
3. Chilli Pepper Crab | calorie : 400 | protein : 10 | carbohydrate : 10 | fats : 20 -- (2)
list
Format: list yyyy-mm-ddTHH:mm yyyy-mm-ddTHH:mm
Example of usage : list 2020-10-29T11:30 2020-10-29T16:40
Salty Chicken Rice | calorie : 300 | protein : 20 | carbohydrate : 10 | fats : 50 – (1) |
Salty Chicken Rice | calorie : 300 | protein : 20 | carbohydrate : 10 | fats : 50 – (1) |
list yyyy-mm-ddTHH:mm
Example of usage : list 1066-10-14T08:00
Output :
Here are the food items recorded in DietBook between 14 Oct 1066 0800 and 29 Oct 2020 1317:
1. Salty Chicken Rice | calorie : 300 | protein : 20 | carbohydrate : 10 | fats : 50 -- (1)
2. Salty Chicken Rice | calorie : 300 | protein : 20 | carbohydrate : 10 | fats : 50 -- (1)
3. Chilli Pepper Crab | calorie : 400 | protein : 10 | carbohydrate : 10 | fats : 20 -- (2)
delete INDEX
Example of usage : delete 2
Output :
Noted. I've removed this food item:
Salty Chicken Rice | calorie : 300 | protein : 20 | carbohydrate : 10 | fats : 50 -- (1)
The list after delete is done :
Here are the food items in DietBook:
1. Salty Chicken Rice | calorie : 300 | protein : 20 | carbohydrate : 10 | fats : 50 -- (1)
2. Chilli Pepper Crab | calorie : 400 | protein : 10 | carbohydrate : 10 | fats : 20 -- (2)
Example of usage : clear
Output :
All previous data has been deleted...
DietBook is now empty.
Before clearing :
Here are the food items in DietBook:
1. Salty Chicken Rice | calorie : 300 | protein : 20 | carbohydrate : 10 | fats : 50 -- (1)
2. Chilli Pepper Crab | calorie : 400 | protein : 10 | carbohydrate : 10 | fats : 20 -- (2)
After clearing :
DietBook is currently empty.
Calculate the amount of nutrition in the foods in intake list.
Format: calculate NUTRITION_NAME [START_TIME] [END_TIME]
calorie
, carbohydrate
, protein
, fat
, and all
.
calorie
: calculate the total amount of calorie from the foods in the intake list.carbohydrate
: calculate the total amount of carbohydrate from the foods in the intake list.protein
: calculate the total amount of protein from the foods in the intake list.fat
: calculate the total amount of fat from the foods in the intake list.all
: calculate the total amount of all five nutrition elements.calculate NUTRITION_NAME
: calculate the amount of nutrition from all foods in the intake list.calculate NUTRITION_NAME [START_TIME]
: calculate the amount of nutrition from the foods after a time in the intake list.calculate NUTRITION_NAME [START_TIME] [END_TIME]
: calculate the amount of nutrition from the foods within a time period in the intake list.yyyy-mm-ddTHH:mm
. For example: 2020-10-29T08:00
.add x/1 n/Salty Chicken Rice k/300
Got it! I've added this food item:
Salty Chicken Rice | calorie : 300 | protein : - | carbohydrate : - | fats : - -- (1)
calculate fat
Total fat intake: 11g
example usage:
calculate carbohydrate 2020-10-29T08:00 2020-10-29T17:00
Output example:
Time period: between 29 Oct 2020 0800 and 29 Oct 2020 1700
Total carbohydrate intake: 80g
Calculate the recommendation based on the person infomation.
Format: recommend Example of usage: recommend
Output :
Hi Jack!
Here is your daily recommended calorie intake: 2607kcal
We use the following list as an example, to set up the list we have the following sequence of inputs
add x/1 n/Salty Chicken Rice k/300 c/10 p/20 f/50
add x/2 n/Chilli Pepper Crab k/400 c/10 p/10 f/20
add x/1 n/Steak Buns k/500 c/20 p/50 f/10
add x/3 n/Sweat potato tea k/300 c/30 p/0 f/0
add x/1 n/Chicken Wing Noodles k/400 c/10 p/30 f/10
list
Here are the food items in DietBook:
1. Salty Chicken Rice | calorie : 300 | protein : 20 | carbohydrate : 10 | fats : 50 -- (1)
2. Chilli Pepper Crab | calorie : 400 | protein : 10 | carbohydrate : 10 | fats : 20 -- (2)
3. Steak Buns | calorie : 500 | protein : 50 | carbohydrate : 20 | fats : 10 -- (1)
4. Sweat potato tea | calorie : 300 | protein : 0 | carbohydrate : 30 | fats : 0 -- (3)
5. Chicken Wing Noodles | calorie : 400 | protein : 30 | carbohydrate : 10 | fats : 10 -- (1)
help
Displays the helping guide for commands.
Format: help
Output example:
Listed below are the valid commands for DietBook:
__________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________
userinfo | To view user information:
| userinfo
__________________________________________________________________________________________________________________________________________
editinfo | To edit user information:
| editinfo [n/NAME] [g/GENDER] [a/AGE] [h/HEIGHT] [o/ORIGINAL_WEIGHT] [c/CURRENT_WEIGHT] [t/TARGET_WEIGHT] [f/FITNESS_LEVEL]
__________________________________________________________________________________________________________________________________________
add | To add a food from the database:
| add i/INDEX x/PORTION_SIZE [yyyy-mm-ddTHH:mm]
__________________________________________________________________________________________________________________________________________
data | To view all food in the database:
| data
__________________________________________________________________________________________________________________________________________
add | To add a food not in the database:
| add x/PORTION_SIZE n/FOOD_NAME k/CALORIE [c/CARBOHYDRATE] [p/PROTEIN] [f/FAT] [yyyy-mm-ddTHH:mm]
__________________________________________________________________________________________________________________________________________
list | To view all food in DietBook:
| list [yyyy-mm-ddTHH:mm] [yyyy-mm-ddTHH:mm]
__________________________________________________________________________________________________________________________________________
delete | To delete a food from DietBook:
| delete INDEX
__________________________________________________________________________________________________________________________________________
clear | To delete all food items from the DietBook:
| clear
__________________________________________________________________________________________________________________________________________
recommend | To get recommended calorie intake:
| recommend
__________________________________________________________________________________________________________________________________________
calculate | To calculate nutritional intake:
| calculate NUTRIENT_TYPE [yyyy-mm-ddTHH:mm] [yyyy-mm-ddTHH:mm]
| Valid NUTRIENT_TYPE: carb, calorie, fat, protein, all
__________________________________________________________________________________________________________________________________________
help | To view a list of valid commands:
| help
__________________________________________________________________________________________________________________________________________
exit | To exit DietBook:
| exit
__________________________________________________________________________________________________________________________________________
exit
Exits the DietBook.
Format: exit
Output example:
Bye! Hope to see you again soon!
Saves the DietBook data when the exit command have been input. The saved data is in 2 files: UserInfo.txt and FoodList.txt.
*Also saves data whenever there is a change in either Person or FoodList data after commands such as add
, clear
,delete
and editinfo
with no message printed.
Output example:
Your data has been saved successfully.
Saved data of FoodList and Person loaded if available. *New file created when saving if no existing data.
Output example:
*With existing data
Loading personal information...
Loading personal food data...
_____________________________________________________________________________________________________________________________________
_______ __ ______ ________ _______ ______ ______ __ __
| __ \| | ___|__ __| __ \ / __ \ / __ \| | / /
| | | | | |___ | | | |__| | | | | | | | |/ /
| | | | | ___| | | | __ <| | | | | | | /
| |__| | | |___ | | | |__| | |__| | | | | |\ \
|_______/|__|______| |__| |_______/ \______/ \______/|__| \__\
Welcome back to DietBook tik!
All your previous data has been successfully loaded and you may start by entering any valid commands.
If you require a list of valid commands, you can enter: help
_____________________________________________________________________________________________________________________________________
*Without existing data
Loading personal information...
_____________________________________________________________________________________________________________________________________
Person data file not found! Creating new personal data....
_____________________________________________________________________________________________________________________________________
Loading personal food data...
_____________________________________________________________________________________________________________________________________
FoodList data file not found! Creating new food list...
_____________________________________________________________________________________________________________________________________
_____________________________________________________________________________________________________________________________________
_______ __ ______ ________ _______ ______ ______ __ __
| __ \| | ___|__ __| __ \ / __ \ / __ \| | / /
| | | | | |___ | | | |__| | | | | | | | |/ /
| | | | | ___| | | | __ <| | | | | | | /
| |__| | | |___ | | | |__| | |__| | | | | |\ \
|_______/|__|______| |__| |_______/ \______/ \______/|__| \__\
Hello! Welcome to DietBook!
I am Diet, your guide to using DietBook. How may I address you?
Please input your name or nickname in the following format:
name YOUR_NAME_OR_NICKNAME
Example: name Jack";
_____________________________________________________________________________________________________________________________________
Q: How do I transfer my data to another computer?
A: Either download dietbook.jar
on the other computer and overwrite the empty data files with the data files from your previous computer or copy the whole DietBook home folder from the previous computer to the new computer.
data from v2.1 is NOT compatible with earlier data. The data is found in C/Users/{User name}/dietbook
. As of v2.1 the food list data is found in the folder
Food##PORTION###dDATE##folder
and the Personal data is found in the folder PERSONA_IS_NO_SUCH_PERSOOSOOSNSNSNS
.
Action | Format, Examples |
---|---|
Enter name |
Note: Used only when setting up DietBook for the first time.name YOUR_NAME_OR_NICKNAME e.g., name Jack
|
Enter info |
Note: Used only when setting up DietBook for the first time.info g/GENDER a/AGE h/HEIGHT o/ORIGINAL_WEIGHT c/CURRENT_WEIGHT t/TARGET_WEIGHT f/FITNESS_LEVEL e.g., info g/M a/21 h/175 o/85 c/85 t/75 f/2
|
View user info | userinfo |
Edit user info |
editinfo [n/NAME] [g/GENDER] [a/AGE] [h/HEIGHT] [o/ORIGINAL_WEIGHT] [c/CURRENT_WEIGHT] [t/TARGET_WEIGHT] [f/FITNESS_LEVEL] e.g., editinfo c/75 f/4
|
Calculate recommended calorie intake | recommend |
Calculate nutrition intake |
calculate NUTRITION_NAME [START_TIME] [END_TIME] e.g., calculate fat
|