-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoops.cpp
40 lines (35 loc) · 857 Bytes
/
oops.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
#include<iostream>
using namespace std;
class Employee
{
public:
string Name;
string Company;
int Age;
void Intro()
{
cout << "Name - " << Name << endl;
cout << "Company - " << Company << endl;
cout << "Age - " << Age << endl;
}
Employee(string name, string company, int age) // parameterised constructor
{
Name = name;
Company = company;
Age = age;
}
};
int main()
{
Employee employee1 = Employee("Rounak", "Apple", 20);
/*employee1.Name = "Rounak";
employee1.Company = "Apple";
employee1.Age = 20;*/
employee1.Intro();
Employee employee2 = Employee("Saldina", "YT-CodeBeauty", 25);
/*employee2.Name = "Saldina";
employee2.Company = "YT-CodeBeauty";
employee2.Age = 25;*/
employee2.Intro();
return 0;
}