24 lines
365 B
C++
24 lines
365 B
C++
#include <iostream>
|
|
|
|
using namespace std;
|
|
|
|
class Employee {
|
|
private:
|
|
int salary;
|
|
public:
|
|
// Setter
|
|
void setSalary(int s) {
|
|
salary = s;
|
|
}
|
|
int getSalary() {
|
|
return salary;
|
|
}
|
|
|
|
};
|
|
|
|
int main() {
|
|
Employee myObj;
|
|
myObj.setSalary(123000);
|
|
cout << myObj.getSalary();
|
|
return 0;
|
|
} |