Inspiration

According to the latest World Health Organization projections, at least one in three of the world's adult population is overweight and almost one in 10 is obese. Additionally there are over 40 million children under age five who are overweight.

Obesity carries serious health consequences, like cardiovascular disease (mainly heart disease and stroke), type 2 diabetes, musculoskeletal disorders like osteoarthritis, and some cancers (endometrial, breast and colon). (Source: https://www.who.int/features/qa/49/en/)

This could, in part, be due to a lack of awareness in the general population of the nutritional content of what they eat. For instance, people tend to underestimate the number of calories they consume in each meal.

What it does

The application allows the user to enter individual recipes. Once a recipe is submitted, the user is prompted to guess the number of calories in the recipe. We then provide the user feedback on how accurate their guess is. The application then searches for a lower calorie substitute for the highest calorie ingredient in the recipe. If one is found, the user is asked if they would like to make the substitution. Finally, the recipe’s ingredients and nutrition facts are stored in a file on the user’s computer for future reference.

How we built it

We used Java as learned in CIT591 and two API’s, one to get the nutritional information of the ingredients and one to look for substitute ingredients. We also used the Opencsv library in order to write and store the information in a file.

Challenges we ran into

There were several challenges, but the main ones include the following: -There is very limited data on ingredient substitution and the substitution also depends on the type of recipe. -API with free access put limits to the queries that we have access to. For instance, the API we use to get nutritional information limits the number of calls to 10 per minute.

Accomplishments that we're proud of

-How we could take a simple idea of inputting a recipe and calculating the calories into something more unique by adding the guessing and substitution features. -How the team worked together seamlessly, especially considering we did not have face to face meetings.

What we learned

We learned about how to retrieve data from API with Java. This involved learning how to use the Okhttp library and how to work is JSON. We also learned to parse the data we received from the API, which involved learning more about regex than we knew previously. Additionally, we learned how to format text in the console.

What's next for KnowCal

We have several ideas, including using a GUI, enhancing the ingredient substitution feature of the application, and giving the user the option to save their session so he/she can track if he/she becomes better at guessing the nutritional information of the recipes.

Built With

Share this project:

Updates