-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCustomer.cpp
More file actions
44 lines (36 loc) · 1.25 KB
/
Customer.cpp
File metadata and controls
44 lines (36 loc) · 1.25 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
#include "Customer.h"
#include <iostream>
using namespace std;
Customer::Customer(string id, string name, string phone, string email, string prefs, string address)
: _customerID(id), _name(name), _phoneNumber(phone), _email(email), _preferences(prefs), _address(address) {}
void Customer::updateProfile(string updatedInfo) {
cout << "Profile updated: " << updatedInfo << endl;
}
void Customer::viewOrderHistory() {
cout << "Order History for " << _name << ":\n";
for (const auto& order : _orderHistory) {
cout << "- " << order << endl;
}
}
void Customer::addOrderHistory(string order) {
_orderHistory.push_back(order);
}
string Customer::getCustomerID() const {
return _customerID;
}
string Customer::getAddress() const {
return _address;
}
void Customer::setAddress(const string& address) {
_address = address;
}
void Customer::displayCustomerDetails() const {
cout << "Customer ID: " << _customerID << endl;
cout << "Name: " << _name << endl;
cout << "Phone: " << _phoneNumber << endl;
cout << "Email: " << _email << endl;
cout << "Preferences: " << _preferences << endl;
if (!_address.empty()) {
cout << "Address: " << _address << endl;
}
}