/* Filename: aboveavg.cpp Author: Br. David Carlson Date: January 24, 1998 Last Revised: November 21, 2001 This program reads from the keyboard the data for a series of employees. (This data consists of each employee's first and last name, ID number, and wage rate.) Data entry is ended when the user enters CTRL z in Windows or CTRL d is Linux. The program calculates and prints the average wage rate and then prints all employee information on those employees who earn over the average. To compile this program you also need: employee.h, employee.cpp, emparray.h, and emparray.cpp Tested with: Microsoft Visual C++ 6.0 Microsoft Visual C++ .NET g++ under Linux */ #include #include "emparray.h" int main(void) { EmpArrayType EmpArray; int Flag, EmpCount; float AvgWageRate; char Reply; Flag = LoadArray(EmpArray, EmpCount); if (Flag == TooMuchDataFlag) cout << endl << endl << "The data would not fit in the array" << endl; else { AvgWageRate = AverageRate(EmpArray, EmpCount); cout << endl << endl << endl << "The average wage rate for all employees was: " << setw(10) << AvgWageRate << endl << endl; cout << "Press g to go on: "; cin >> Reply; cout << endl << "Employees with wage rates above average:" << endl; PrintAboveAvg(EmpArray, EmpCount, AvgWageRate); } return 0; }