-
Notifications
You must be signed in to change notification settings - Fork 0
/
Customer.cpp
61 lines (51 loc) · 1.1 KB
/
Customer.cpp
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
#pragma once
#include"Person.cpp"
#include<string>
#include<fstream>
using namespace std;
// lop Customer ke thua tu lop Person
class Customer :public Person{
private:
string id;
string phone;
public:
Customer(){}
Customer(string id, string phone) {
this->id = id;
this->phone = phone;
}
~Customer(){}
void set_id(string id) {
this->id = id;
}
void set_phone(string phone) {
this->phone = phone;
}
string get_id() {
return id;
}
string get_phone() {
return this->phone;
}
void input() {
cin.ignore();
cout << "Please Enter Your Name: ";
getline(cin, this->full_name);
cout << "Please Enter Your Age: ";
cin >> this->age;
cin.ignore();
cout << "Please Enter Your gender: ";
getline(cin, this->gender);
cout << "Please Enter Your ID: ";
getline(cin, this->id);
cout << "Please Enter Your Phone: ";
getline(cin, this->phone);
}
void display() {
cout << "Name: " << this->full_name << endl;
cout << "Age:" << this->age << endl;
cout << "Gender: " << this->gender<<endl;
cout << "ID: " << this->id << endl;
cout << "Phone: " << this->phone<<endl;
}
};