موقع طلبة جامعة البحرين

يمكنك تصفح الموقع كزائر ولكن ندعوك لتسجيل عضوية خاصة بك لتحصل على كافة الصلاحيات مثل تنزيل ملفات المكتبة وقراءة تعليقات هيئة التدريس وغيرها. يمكنك الحصول على عضوية مجانية بالضغط على زر تسجيل. إذا قمت بالتسجيل مسبقا فيمكنك الضغط على زر دخول.

تسجيل دخول
  • قسم المكتبة الجامعية مغلق مؤقتا بعد الاستهداف التي تعرضت له بعض خدمات أمازون في البحرين، جاري استرجاع الملفات ونقلها إلى سيرفرات جديدة وسيتم بعدها اعادة افتتاح المكتبة

ممكن مساعدة في حل هذا السؤال؟؟

LIMELIGHT

Active Member
تاريخ التسجيل
28 سبتمبر 2009
المشاركات
28
المجموعة
ذكر
الدفعة الدراسية
معلومة خاصة
الكلية
كلية تقنية المعلومات
السلام عليكم.....

عندي سؤال يتعلق بـــ ITCS102 ..
السؤال يتعلق بـــ Class و بــــStruct

احد يقدر احله وبكوون شااااكر له ..

او على الاقل افهمني اياه :)


السؤال

Consider the following structure Date
struct Date
{
int month;
int day;
int year;
};


Use the class EmployeeInfo that uses the Date structure in solving the problem below
class EmployeeInfo
{
private:
int ID;
string firstname;
string lastname;
double salary;
Date hiredate;
public:
void setInfo(int, string, string, double, date);
int getID() const;
string getFname() const;
string getLname() const;
double getSalary() const;
Date getDate();
EmployeeInfo ();
EmployeeInfo (int,string,string,double,Date);
};


1. Write the code for each member functions.
2. Write a program that defines array of EmployeeInfo of size 15. The program should ask the user to enter the data of those employees and store them in the array. Then the program displays the information of employee that has largest salary.



في حال عدم وضوح السؤال , يوجد نسخة له في المرفقات

شكرا
 

المرفقات

هذه محاولتي في حله

void EmployeeInfo::setInfo(int id, string fn, string ln, double S, Date hd)
{
ID=id;
firstname=fn;
lastname=ln;
salary=S;
hiredate=hd;
}


int EmployeeInfo::getID() const
{
return ID;

}

string EmployeeInfo::getFname() const
{
return firstname;

}

string EmployeeInfo::getLname() const
{
return lastname;

}

double EmployeeInfo::getSalary() const
{
return salary;

}

Date EmployeeInfo::getDate()
{
return hiredate ;

}

EmployeeInfo::EmployeeInfo()
{
ID=0;
firstname=" ";
lastname=" ";
salary=0.0;

}

EmployeeInfo::EmployeeInfo(int id,string fn,string ln,double S,Date hd)
{
setInfo(id,fn,ln,S,hd);

}

int main()
{
int i;
EmployeeInfo arr[15];
for(i=0;i<15;i++)
cout<<"ENTER";
cin>>arr;

}


:sad_1:
 
عودة
أعلى أسفل