-
Notifications
You must be signed in to change notification settings - Fork 0
/
Person2.h
executable file
·50 lines (34 loc) · 1013 Bytes
/
Person2.h
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
#include <iostream>
#include <string>
#include <array>
#include "Address.h"
using namespace std;
class Person2
{
//static : common to all instances
static int lifeExpectancy;
//private method
int findAge() const; // const to be sure that age is not modified
// define public fields of instances
public:
string name_;
int age;
void WhoAmI();
const static int Mr = 0;
const static int Ms = 1;
int civility;
static int getLifeExpectancy();
int getPersonLE();
int getCivility();
Address *address;
// constructor
Person2();
Person2(string name, int civility, int age);
Person2(string name, int civility, int age, int no, string street, string city);
//destructor
~Person2();
// constructor by copy
Person2(const Person2 &p); // const to prevent any modification of the person in argument
// constructor by assignment of a copy. Override '=' operator
Person2 &operator=(const Person2 &SourcePerson);
};