-
Notifications
You must be signed in to change notification settings - Fork 0
/
association.cpp
47 lines (40 loc) · 874 Bytes
/
association.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
#include <iostream>
using namespace std;
class Bank {
private:
string name;
public:
Bank(string name)
{
// this keyword refers to current instance itself
this->name = name;
}
string getBankName()
{
// Returning name of bank
return name;
}
};
class Employee {
// Attributes of employee
private:
string name;
public:
Employee(string name)
{
// This keyword refwrs to current insytance itself
this->name = name;
}
string getEmployeeName()
{
return name;
}
};
int main()
{
Bank bank("HBL GULSHAN BRANCH");
Employee emp("ALI ABBAS");
// Print and display name and
// corresponding bank of employee
cout<<emp.getEmployeeName()+ " is employee of "+ bank.getBankName();
}