-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCustomer.h
More file actions
66 lines (51 loc) · 1.35 KB
/
Customer.h
File metadata and controls
66 lines (51 loc) · 1.35 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
#ifndef Customer_H
#define Customer_H
#include <string>
#include <ostream>
class Customer {
private:
int customer_id;
std::string fname;
std::string lname;
std::string email;
int points;
public:
Customer() : customer_id(0), fname(""), lname(""), email(""), points(0) {}
Customer(int customer_id, std::string fname, std::string lname, std::string email, int points)
: customer_id(customer_id), fname(fname), lname(lname), email(email), points(points) {}
const int getCustomerID() {
return customer_id;
}
const std::string& getFirstName() {
return fname;
}
void setFirstName(const std::string& newFirstName) {
fname = newFirstName;
}
const std::string& getLastName() {
return lname;
}
void setLastName(const std::string& newLastName) {
lname = newLastName;
}
const std::string& getEmail() {
return email;
}
void setEmail(const std::string& newEmail) {
email = newEmail;
}
const int getPoints() {
return points;
}
void setPoints(const int newPoints) {
points = newPoints;
}
friend std::ostream& operator<<(std::ostream& os, const Customer& customer) {
os << "<Customer ID(" << customer.customer_id << "), fname(" << customer.fname << "), lname(" << customer.lname << "), email(" << customer.email << "), points(" << customer.points << ")/>";
return os;
}
bool operator!() const {
return customer_id == 0;
}
};
#endif