-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoop.cpp
38 lines (33 loc) · 864 Bytes
/
oop.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
#include <iostream>
using namespace std;
class Employee {
private:
string Name;
string Company;
int Age;
public:
void Greeting(){
cout << "Name - " << Name << endl;
cout << "Company - " << Company << endl;
cout << "Age - " << Age << endl;
}
Employee(string name, string company, int age) {
Name = name;
Company = company;
Age = age;
}
};
int main(){
int number;
Employee emp1 = Employee("Julek", "Politechnika", 20);
// emp1.Name = "Julek";
// emp1.Company = "Politechnika";
// emp1.Age = 20;
emp1.Greeting();
Employee emp2 = Employee("Agnieszka", "Multikino", 25);
// emp2.Name = "Agnieszka";
// emp2.Company = "UAM";
// emp2.Age = 25;
emp2.Greeting();
return 0;
}