-
Notifications
You must be signed in to change notification settings - Fork 0
/
ExpenseManager.h
39 lines (31 loc) · 968 Bytes
/
ExpenseManager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef EXPENSEMANAGER_H
#define EXPENSEMANAGER_H
#include <conio.h>
#include <algorithm>
#include "AuxiliaryMethods.h"
#include "Expense.h"
#include "ExpenseFile.h"
using namespace std;
class ExpenseManager
{
const int LOGGED_USER_ID;
vector<Expense> expenses;
ExpenseFile expenseFile;
Expense getNewExpenseData();
int getNewExpenseId();
void displayExpenseHeader();
void displayExpensesVector(vector<Expense> &expenses);
float getTotalExpensesValueInVector(vector<Expense> &expenses);
public:
ExpenseManager(string fileName, int loggedUserId)
: LOGGED_USER_ID(loggedUserId),
expenseFile(fileName)
{
expenses = expenseFile.loadExpensesFromFile(LOGGED_USER_ID);
}
void addExpense();
float displayCurrentMonthExpenses();
float displayLastMonthExpenses();
float displayChosenPeriodExpenses(time_t beginPeriodUnixTime, time_t endPeriodUnixTime);
};
#endif // EXPENSEMANAGER_H