Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added caloriebalance feature #226

Closed
33 changes: 23 additions & 10 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Type `help` to see a list of commands that you will be able to use in the applic
* [Viewing list of all steps: `viewsteps`](#Viewing-list-of-all-steps-viewsteps)
* [Exiting the application : `exit`](#exiting-the-application-exit)


### First Time Users
If you are using FitTrack for the first time, you are required to enter your height, weight, gender and daily calorie limit before being
able to access all features.
Expand Down Expand Up @@ -104,7 +105,7 @@ Existing commands:
help, exit,
editprofile, viewprofile, bmi, checkrecommendedweight,
addmeal, deletemeal, viewmeal, findmeal, caloriesconsumed
addworkout, deleteworkout, viewworkout, findworkout, caloriesburnt
addworkout, deleteworkout, viewworkout, findworkout, caloriesburnt, caloriebalance
Type `help` or `help <COMMAND>` to view help.
```

Expand Down Expand Up @@ -367,7 +368,9 @@ caloriesburnt 2023-11-04
Total calories burnt on 2023-11-04: 230kcal
```

### Checking calorie balance on a specific date: `caloriebalance`

### Checking calorie balance on a specific date: `caloriesbalance`

Allows user to check their calorie balance (surplus/deficit) on a specific date.

Format
Expand All @@ -383,22 +386,31 @@ caloriebalance 2023-11-04

- If the user is in a calorie surplus:
```
You have exceeded your calorie limit on 2023-11-07 by: 4910.0kcal
You are in a calorie surplus!
Try doing more exercises if you want to eat!
You have exceeded your calorie limit on 2023-11-07 by: 4910.0kcal
You are in a calorie surplus!
Try doing more exercises if you want to eat!
```

- If the user is left with 0 in his calorie balance:
```
Your calorie balance on 2023-11-07 is: 0.0kcal
Try doing more exercise if you want to eat!
Your calorie balance on 2023-11-07 is: 0.0kcal
Try doing more exercise if you want to eat!
```

- If the user is in a calorie deficit:
```
Your calorie balance on 2023-11-07 is: 200.0kcal
You are in a calorie deficit!
You can try to eat more!
Your calorie balance on 2023-11-07 is: 200.0kcal
You are in a calorie deficit!
You can try to eat more!
```

### Check the ideal weight range given current height: `checkrecommendedweight`
Allows the user to check the ideal weight range given their current height. This is calculated based
on a standard formula.

**Example of usage**
```
checkrecommendedweight
```


Expand Down Expand Up @@ -565,3 +577,4 @@ The contents of workoutList.txt:
| Viewing the total number of steps on a specific date | `totalsteps <DATE>` |
| Viewing the list of steps | `viewsteps` |
| Getting a suggestion on your steps walked | `getstepssuggestion <DATE>` |

2 changes: 1 addition & 1 deletion src/main/java/fittrack/command/CalorieBalanceCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ public void setArguments(String args) throws ParseException {
protected String getHelp() {
return HELP;
}
}
}
1 change: 1 addition & 0 deletions src/main/java/fittrack/parser/CommandParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import fittrack.command.DeleteStepsCommand;
import fittrack.command.GetStepsSuggestion;


import java.util.regex.Matcher;
import java.util.regex.Pattern;

Expand Down