PDA

نسخه کامل مشاهده نسخه کامل : این کد چه مشکلی داره؟



mahdi7s
18-06-2008, 17:38
دوستان عزیز من نمی دونم مشکل این کد چیه یکی بهم میگه!:11:




#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;
}

hamed valizadeh
18-06-2008, 20:30
Here is your code:

برای مشاهده محتوا ، لطفا وارد شوید یا ثبت نام کنید

mahdi7s
19-06-2008, 18:57
گیرم کمکم کنید
یکی مشکلشو بگه

hamed valizadeh
19-06-2008, 19:55
salam, basheh
akhareh
void CoutAge()
void CoutYearsOfService()
void CoutSalary()
acoolad nazashteh boodi.
chandja esmeh moteghayyer ha ro eshtebah neveshteh boodi
moteghaier hayeh lazeme ro bayad ghabl az estefadeh tarif kard
dakheleh class barayeh estefadeh az function ha niaz be neveshteaneh esmeh class nist

alan ghader beh farsi neveshtan nistam :(