A simple console-based expense tracker application written in C++ to help manage and track your expenses.
- Add expenses with date, amount, category, and description
- View a list of all expenses
- Delete expenses by ID
- Save expenses to a file for persistence
- Load expenses from a file on startup
- C++11 or later
- g++ compiler (or any C++ compiler that supports C++11)
-
Clone the repository or download the source files (
ExpenseTracker.h,ExpenseTracker.cpp, andmain.cpp). -
Navigate to the directory containing the source files.
-
Compile the program using g++:
g++ -std=c++11 -o expense_tracker main.cpp ExpenseTracker.cpp
-
Run the compiled program:
./expense_tracker
Upon running the program, you will see a menu with the following options:
- Add Expense: Add a new expense by entering the date, amount, category, and description.
- View Expenses: Display a list of all expenses.
- Delete Expense: Delete an expense by entering its ID.
- Exit: Exit the program.
-
Add an Expense:
Enter date (YYYY-MM-DD): 2024-07-23 Enter amount: 50.0 Enter category: Food Enter description: Dinner at a restaurant Expense added successfully. -
View Expenses:
ID Date Amount Category Description 1 2024-07-23 50.0 Food Dinner at a restaurant -
Delete an Expense:
Enter expense ID to delete: 1 Expense deleted successfully. -
Exit:
Exiting...
ExpenseTracker.h: Header file containing theExpensestruct andExpenseTrackerclass definition.ExpenseTracker.cpp: Implementation of theExpenseTrackerclass methods.main.cpp: Contains the main function and user interface for interacting with the expense tracker.
If you wish to contribute to the project, please fork the repository and submit a pull request with your changes.
This project is licensed under the MIT License. See the LICENSE file for details.