دوستان عزیز من نمی دونم مشکل این کد چیه یکی بهم میگه!
#include <iostream>
using namespace std;
class Employee
{
public:
Employee(int age) { itsAge = age; }
~Employee() { }
int GetAge() const { return itsAge; }
int GetSalary() const { return itsSalary; }
int GetYearsOfService() const { return itsYearsOfService; }
void SetAge(int age) { itsAge = age; }
void SetSalary(int salary) { itsSalary = salary; }
void SetYearsOfService(int years) { itsYearsOfService = years; }
void CoutAge() const { cout <<"\nHis Age is "<<MyEmployee.GetAge() <<" years old.\n";
void CoutSalary() const { cout <<"\nHis Salary is "<<MyEmployee.GetSalary() <<" Rial.\n";
void CoutYearsOfService() const { cout <<"\nThe years of service is "<<MyEmployee.YearsOfService <<"!@!\n";
private:
int itsAge;
int itsSalary;
int itsYearOfService;
};
int main()
{
Employee MyEmployee(56);
MyEmployee.SetSalary(400000);
MyEmployee.SetYearsOfService(2);
return 0;
}