-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMember.cpp
More file actions
executable file
·63 lines (50 loc) · 1.39 KB
/
Member.cpp
File metadata and controls
executable file
·63 lines (50 loc) · 1.39 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//
// Created by nikang on 12/22/16.
//
#include "Member.h"
#include "Library.h"
long Member::getMember_id() const {
return member_id;
}
int Member::getNumber_of_book_issued() const {
return number_of_book_issued;
}
int Member::getMax_book_limit() const {
return max_book_limit;
}
const string &Member::getName() const {
return name;
}
Date *Member::getDate_of_membership() const {
return date_of_membership;
}
Bill *Member::getBill() const {
return bill;
}
const vector<Transaction *> &Member::getTransactions() const {
return transactions;
}
void Member::borrowing(Transaction *transaction) {
this->transactions.push_back(transaction);
this->number_of_book_issued++;
}
void Member::return_book(double late) {
this->number_of_book_issued--;
this->bill->update_bill(late);
}
Member::Member(const string &name, Date *date_of_membership) : name(name) {
this->max_book_limit = 4;
this->bill = new Bill();
this->number_of_book_issued = 0;
this->date_of_membership = new Date;
this->date_of_membership = date_of_membership;
this->member_id = Library::Id_generator();
this->is_deleted = false;
}
bool Member::isIs_deleted() const {
return is_deleted;
}
string Member::remove() {
double pay = this->bill->pay_bill();
return "He/She have to Pay " + to_string(pay) + "and return " + to_string(this->number_of_book_issued) + "books \n";
}