Presentation is loading. Please wait.

Presentation is loading. Please wait.

My Final Project: Calorie Counter

Similar presentations


Presentation on theme: "My Final Project: Calorie Counter"— Presentation transcript:

1 My Final Project: Calorie Counter
By Chase Fortier

2 Background and Motivations
There are currently many applications and websites available that help track one’s health and fitness in a variety of ways. I am interested in health and fitness, which motivated me to try to create my own calorie counter to keep track of one’s daily food intake. My limited prior background in python motivated me to explore it’s functions

3 General display

4 Tools Used Dictionary Labels (Tkinter Widget)
Each food defined as a list in the food dictionary. Lists stored in format [# calories per serving,” serving size”] Labels (Tkinter Widget) Used to prompt the user on what to enter Also used to display results Attributes: Location (grid) to create logical flow, Text Color (fg) to make clear what should be entered next, Text- prompts changed at certain points, Appearance (Relief) makes it either flat, raised, or indented Entry Boxes (Tkinter Widget) Allow user to input text within the window rather than into the shell Attributes: location (grid) Buttons (Tkinter Widget) Pressing and release of button linked to a command- allows entry to be input and program to continue Attributes: location (grid), Size (height and width), Text (Enter, Add, etc.)

5 Capabilities of the program
Changing font colors guide the user to input into specific entry boxes If a food listed in the dictionary is entered, the program retrieves the serving size, which is then displayed to the user If the food is not in the dictionary, the program prompts them to enter the number of calories per servings Number of calories consumed is calculated by multiplying the stored or entered value for # of calories per serving * # of servings Foods entered and corresponding calories is displayed and updated each time a new entry food is completed When the used clicks “Finish and Calculate”, the values for the number of calories consumed of each food are added together, and then the total number is displayed in the window

6 Outcome

7 Challenges Limited background in python
Incorporating python program into the Tk window Raw_input  Entry Boxes Print  Changing Labels Loops  Buttons Keeping track of specific variables and changing their value depending on user input. Learning how attributes can be manipulated

8 Improvements to be made
Allow floats to be entered instead of integers Account for user error: Function for if the number of calories or number of servings entered is not a number Only display the Label/Entry Box/ and Button for a single step at a time- cause others to disappear and reappear as the program progressed Incorporate nutritional values into dictionary and display daily intake of nutrients Create a larger dictionary with more specific foods i.e. cooked broccoli vs. uncooked broccoli

9 THANK YOU! QUESTIONS?


Download ppt "My Final Project: Calorie Counter"

Similar presentations


Ads by Google