This C++ program is designed to assist users in managing their personal health and nutrition. It provides functionalities for user registration, login, health assessment, and food consumption tracking. The program uses object-oriented principles to organize data and interactions effectively.
-
User Registration: Users can register with a username and password. Their credentials are securely stored for future logins in a text file (
user_credentials.txt). -
User Login: Registered users can log in by entering their username and password. The program verifies their credentials against the stored data, providing access upon successful login.
-
BMI Calculation: After logging in, users provide their gender, height (in feet and inches), and weight (in kilograms). The program calculates their Body Mass Index (BMI).
-
Health Rating: Based on the calculated BMI, the program provides a health rating, categorizing the user's health status as Underweight, Normal, Overweight, or Obese, with associated health risk levels.
-
Food Database: The program maintains a database of predefined food items, each with nutritional information, including calories, protein, and fat per 100 grams.
-
Daily Food Log: Users can log their daily food consumption by entering the names of foods they've eaten and the number of servings for each item. The program calculates and displays the total daily calories, protein, and fat intake.
- Class Hierarchy: Object-oriented programming principles are used to represent food items, consumed foods, and daily food logs using classes such as
FoodItem,ConsumedFood, andDailyFoodLog.
- Credential Security: User credentials are stored securely in a text file (
user_credentials.txt), and the program checks the entered credentials during login to ensure user privacy.
- Console Interface: The program interacts with users through the console, providing clear prompts for input and displaying results.
-
Clone or download the repository to your local machine.
-
Compile the code using a C++ compiler. For example, you can use g++:
g++ -o health_management health_management.cpp
-
Run the compiled executable:
./health_management
-
Follow the on-screen prompts to register, log in, and utilize the program's features.
- This program is written in C++ and uses standard libraries. No external dependencies are required.
- This project was created as a demonstration of C++ programming skills and object-oriented design principles.
Feel free to customize this README file to include any additional information or specific instructions for your project.