forked from codebloded/BackToBasics.cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclassObj.cpp
More file actions
31 lines (31 loc) · 724 Bytes
/
classObj.cpp
File metadata and controls
31 lines (31 loc) · 724 Bytes
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
#include<iostream>
using namespace std;
class Employee
{
private:
int salary, pts;
public:
int experience;
string name ;
void setData(int _salary,int _pts);
void getData();
};
void Employee :: setData(int _salary, int _pts){
salary=_salary;
pts = _pts;
}
void Employee :: getData(){
cout<<"The name of the Employee is :"<<name<<endl;
cout<<"The experience of Employee is :"<<experience<<endl;
cout<<"The salary of Employee is :"<<salary<<endl;
cout<<"The points of Employee is :"<<pts<<endl;
}
int main()
{
Employee rohan;
rohan.name = "Codebloded(Rohan)";
rohan.experience =4;
rohan.setData(4,24);
rohan.getData();
return 0;
}