-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTransaction.h
More file actions
44 lines (37 loc) · 890 Bytes
/
Transaction.h
File metadata and controls
44 lines (37 loc) · 890 Bytes
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
#ifndef Transaction_H
#define Transaction_H
#include <string>
class Transaction {
private:
int transaction_id;
int customer_id;
float total;
std::string order_date;
public:
Transaction(
int transaction_id,
int customer_id,
float total,
std::string order_date
) : transaction_id(transaction_id),
customer_id(customer_id),
total(total),
order_date(order_date) {}
int getTransactionID() {
return transaction_id;
}
int getCustomerID() {
return customer_id;
}
float getTotal() {
return total;
}
std::string getOrderDate() {
return order_date;
}
friend std::ostream& operator<<(std::ostream& os, const Transaction& transaction) {
os << "<Transaction ID(" << transaction.transaction_id << "), customer_id(" << transaction.customer_id << "), total(" << transaction.total << "), order_date(" << transaction.order_date << ")/>";
return os;
}
};
#endif