write a program that reads information about 20 employees and store it in a array of strucures, the structure of each employee should contain : name 9does not exceed 20 characters), ID (int) , salary (double) between 200 and 4000 and address which belongs to one of the following {A,B,C,D,E} the progrem should then output the following :
1- the average of employee salaries.
2- the names of employees whose salaries are above the average.
وهذا هو الحل
#include "iostream.h"
struct employee {
char name[20];
int ID;
double 200;
};
void main()
{
int sum=0;
float avg;
employee a[20];
employee a;
a.name;
a.salary;
}
for (int i=0;i<20;i++)
sum=sum+A;
avg=sum/20;
cout<<avg<<endl;
for (int i=0;i<20;i++)
if (A.salary>avg)
cout<<A.names<<endl;
}
}
#include "stdafx.h"
