-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTransaction.cpp
More file actions
executable file
·79 lines (70 loc) · 1.43 KB
/
Transaction.cpp
File metadata and controls
executable file
·79 lines (70 loc) · 1.43 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//
// Transaction.cpp
// Transaction
// Description CPP file of Transaction Class
// Created by Swasti Gupta on 5/31/15.
//
//
#include "Transaction.h"
/*
Description constructor of Transaction Class
*/
Transaction::Transaction()
{
mTransactionAmnt = 0;
mCustomerId = "";
}
/*
param bookId to be added
Description add Book to purchased book List
*/
void Transaction::addBook(string bookId)
{
mPurchasedBookList.push_back(bookId);
}
/*
Description returns the purchased book list
*/
list<string>& Transaction::getPurchasedBookList()
{
return mPurchasedBookList;
}
/*
param total transction amount
Description sets the transaction amount
*/
void Transaction::setTransactionAmnt(double sum)
{
mTransactionAmnt = sum;
}
/*
Description returns the total transaction amount
*/
double Transaction::getSum()
{
return mTransactionAmnt;
}
/*
param customerId to be set
Description sets the customerId of purchaser
*/
void Transaction::setCustomerId(string custId)
{
mCustomerId = custId;
}
/*
Description returns the customerId of the purchaser
*/
string Transaction:: getCustomerId()
{
return mCustomerId;
}
/*
param object of transaction type to be compared
param customerId to be compared
Description compares the customerId of
the transactions object with the given customerId
*/
bool operator == (Transaction obj, string custId){
return (obj.mCustomerId.compare(custId) == 0);
}