/********************************************************************* C201 Computer Programming II Fall 2006 Dana Vrajitoru & The main function using the structure Employee_rec. **********************************************************************/ #include "employee.h" #include #include // Prototypes for functions defined here. void Test_flags(Employee_rec staff[], int size); int main() { Employee_rec *personnel; int n; printf("Enter the number of employees\n"); scanf("%d", &n); personnel = new Employee_rec[n]; Input_all(personnel, n); Output_all(personnel, n); Test_flags(personnel, n); // test the sorting functions Sort_by_id(personnel, n); printf("The list of all employees sorted by their id:\n"); Output_all(personnel, n); return 0; } //Testing the flags that use binary encoding. void Test_flags(Employee_rec staff[], int size) { int i, j; // Input one employee number and set its hourly flag to true. printf("Enter an employee number [0 - %d] to make hourly.\n", size); scanf("%d", &i); Set_hourly(staff[i]); // Input an employee number and the gender and set the gender flag // to the value entered by the user. printf("Enter an employee number and the gender (0/1 for M/F)\n"); printf("Number: "); scanf("%d", &i); printf("Gender: "); scanf("%d", &j); Set_gender(staff[i], Gender(j)); printf("These are all hourly employees:\n"); Output_all_hourly(staff, size); printf("These are all employees:\n"); Output_all_gender(staff, size); }