-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaggregation.cpp
More file actions
79 lines (74 loc) · 1.53 KB
/
Copy pathaggregation.cpp
File metadata and controls
79 lines (74 loc) · 1.53 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
67
68
69
70
71
72
73
74
75
76
77
78
79
#include <iostream>
using namespace std;
class driver
{
protected:
string driver_name;
bool lisenced;
public:
driver(string driver_name, bool lisenced)
{
this->driver_name = driver_name;
this->lisenced = lisenced;
}
void setdriver(string driver_name, bool lisenced)
{
this->driver_name = driver_name;
this->lisenced = lisenced;
}
string getdrivername()
{
return driver_name;
}
bool getdriverlisenced()
{
return lisenced;
}
};
class car
{
protected:
string car_name;
string car_no_plate;
driver *obj;
public:
car()
{
car_name = "WOLKSWAGON";
car_no_plate = "ABC-123";
}
car(string car_name, string car_no_plate, driver *obj)
{
this->car_name = car_name;
this->car_no_plate = car_no_plate;
this->obj = obj;
}
car(const car &obj)
{
this->car_name = obj.car_name;
this->car_no_plate = obj.car_no_plate;
}
void setcar(string car_name, string car_no_plate)
{
this->car_name = car_name;
this->car_no_plate = car_no_plate;
}
string getcarname()
{
return car_name;
}
string getcarnoplate()
{
return car_no_plate;
}
};
int main()
{
{
driver d1("jamal", false);
{
car c1("alto", "tkk-002", &d1);
}
cout << "lisence is or not:" << d1.getdriverlisenced() << endl;
}
}