A simple tool that can be used to keep track of daily household expenses, made using basic OOPs features in C++ and a little bit of file handling
- For Windows users: firstly install
make
for executingmakefile
, from this link; - For Linux users:
make
generally comes pre-installed;- if not, then run the following command:
sudo apt-get install make
- if not, then run the following command:
- Now, run the following commands:
- for building executable file:
make all # universal;
- for executing it:
make run # universal;
- for deleting executable file:
make clean # for linux/macOS; make clean(win) # for windows;
- rendered by mermaid
classDiagram direction RL class ExpenseManager{ -$map~long long, Expense~ expenses -$map~long long, string~ commodityTypes +$addExpense(Expense) void +$removeExpense(Expense) void +$getExpenseDetails() Expense +$calculateExpenditure() void +$printExpenses() void +$addCommodityType(string) void +$removeCommodityType(string) void +$getCommodityType() string +$printCommodityTypes() void +$readFromCSV() void +$writeToCSV() void } class Expense{ -long long id -Date date -Commodity commodity -double quantity -double amount +Expense() void +Expense(long long, Date, Commodity, double, double) void +setId(long long) void +setDate(Date) void +setCommodity(Commodity) void +setQuantity(double) void +setAmount(double) void +getId() long long +getDate() Date +getCommodity() Commodity +getQuantity() double +getAmount() double +inputDetails() void +printDetails() void +$printDetails(vector~Expense~) void } class Commodity{ -string name -string type -double rate +Commodity() void +Commodity(string, string, double) void +setName(string) void +setType(string) void +setRate(double) void +getName() string +getType() string +getRate() double +inputDetails() void +printDetails() void } class Date{ -int day -int month -int year +Date() void +Date(int, int, int) void +setDay(int) void +setMonth(int) void +setYear(int) void +getDay() int +getMonth() int +getYear() int +inputDetails() void +printDetails() void +stringToDate(string) void +dateToString() string +value() int +validateDate() bool } ExpenseManager *-- Expense Expense *-- Commodity Expense *-- Date link ExpenseManager "https://github.com/code-chaser/expense-manager/blob/main/include/ExpenseManager.hh" "click to see declaration" link Expense "https://github.com/code-chaser/expense-manager/blob/main/include/Expense.hh" "click to see declaration" link Commodity "https://github.com/code-chaser/expense-manager/blob/main/include/Commodity.hh" "click to see declaration" link Date "https://github.com/code-chaser/expense-manager/blob/main/include/Date.hh" "click to see declaration"
- C++