- تاريخ التسجيل
- 14 سبتمبر 2012
- المشاركات
- 2,834
- المجموعة
- ذكر
- الدفعة الدراسية
- 2012
- الكلية
- كلية تقنية المعلومات
- التخصص
- CS - متقاعد
سلام
ممكن تشوفون ليي الغلط في هالبرنامج
يطلع ليي 29 ايرورHTML:#include<iostream>#include <string>using namespace std;struct nameType{string firstName;string lastName;};struct dateType{int day;int month;int year;};struct personalInfoType {long ID;nameType name;int salary;dateType DateOfBirth;};personalInfoType Emp1 ;void getData(personalInfoType Employees[], int numEmployee){cout<<"enter your name,id and DateofBirth";for(int i=0;i<numEmployee;i++)cin>>Employees[i].ID>>Employees[i].name.firstName>>Employees[i].name.lastName>>Employees[i].DateofBirth.day>>Employees[i].DateofBirth.month>>Employees[i].DateOfBirth.day;}void printData( personalInfoType Employees[],int numEmployee){for(int i=0;i<numEmployee;i++)cout<<Employees[i].ID<<endl;cout<<Employees[i].name.firstName<<endl;cout<<Employees[i].name.lastName<<endl;cout<<Employees[i].DateofBirth.year<<endl,cout<<Employees[i].DateOfBirth.month<<endl;cout<<Employees[i].DateOfBirth.day<<endl;}void bornSameYearMonth(personalInfoType Employees[], int numEmployee,personalInfoType Emp1){for (int i=0,i<numEmployee;i++){if (Emp1.DateofBirth.year==Employees[i].DateofBirth.year&&Emp1.DateOfBirth.day==Employees[i].DateOfBirth.day)cout<<Employees[i].name.firstName<<endl;cout<<Employees[i].name.lastName<<endl; }} void PrintLowSalaries(personalInfoType Employees[],int numEmployee){cout<<"theemployees with salary less than 200 are";for (int i=0; i<numEmployee; i++){if (Employees[i].salary<200)cout<<Employees[i].ID<<endl;cout<<Employees[i].name.lastName<<endl;}
عدلتهم ..
كود:
#include<iostream>
#include <string>
using namespace std;
struct nameType
{
string firstName;string lastName;
};
struct dateType
{
int day;int month;int year;
};
struct personalInfoType
{
long ID;nameType name;
int salary;
dateType DateOfBirth;
};
personalInfoType Emp1
;void getData(personalInfoType Employees[], int numEmployee)
{
cout<<"enter your name,id and DateofBirth";
for(int i=0;i<numEmployee;i++)
cin>>Employees[i].ID>>Employees[i].name.firstName>>Employees[i].name.lastName>>Employees[i].DateOfBirth.day>>Employees[i].DateOfBirth.month>>Employees[i].DateOfBirth.day;
}
void printData( personalInfoType Employees[],int numEmployee)
{
for(int i=0;i<numEmployee;i++)
{
cout<<Employees[i].ID<<endl;
cout<<Employees[i].name.firstName<<endl;
cout<<Employees[i].name.lastName<<endl;
cout<<Employees[i].DateOfBirth.year<<endl;
cout<<Employees[i].DateOfBirth.month<<endl;
cout<<Employees[i].DateOfBirth.day<<endl;
}
}
void bornSameYearMonth(personalInfoType Employees[], int numEmployee,personalInfoType Emp1)
{
for (int i=0;i<numEmployee;i++)
{
if (Emp1.DateOfBirth.year==Employees[i].DateOfBirth.year&&Emp1.DateOfBirth.day==Employees[i].DateOfBirth.day)
cout<<Employees[i].name.firstName<<endl;cout<<Employees[i].name.lastName<<endl;
}
}
void PrintLowSalaries(personalInfoType Employees[],int numEmployee)
{
cout<<"theemployees with salary less than 200 are";
for (int i=0; i<numEmployee; i++)
{
if (Employees[i].salary<200)cout<<Employees[i].ID<<endl;cout<<Employees[i].name.lastName<<endl;
}
}








