Question: Write a c++ program that inputs (at most 50) records from a sequential file. Use the following structure definition in your program. Write a c++
Write a c++ program that inputs (at most 50) records from a sequential file.
Use the following structure definition in your program.
Write a c++ program to insert the records into an ordered (maintain order at all times) array (max 50 records)(ordered by Last_name in alphabetical order). Then print the records in ordered by last name. Years if service 0 5 4.5% (based on annual salary) , 6 10 12.5% 11- 15 30.85% 16 20 45.9% over 20 65.90% annual retirement salary. Department codes AC accounting MD medical EG engineering TE technical PP -physical plant ST staff LW legal Rd research TT testing QC -quality control.
Validate the data in each record before storing it in the data structure, any record found to be in error should be written to an
to a file called "error.dat" along with the reason for the error.
Error file Error Messages
record 99 < start date month error 13/22/89
Total number of error record 99
Struct listnode {
char last_name [15];
char first_name[15];
unsigned start_month;
unsigned start_day;
unsigned start_year; // 4 digits
unsigned end_month; // 0 if still active
unsigned end_day; //0 if still active
unsigned end_year; // 0 if still active
float annual_salary;
string dept_code; // Note: may be entered in either upper or lower case (two characters)
string email_address[25];
}; // end structure
sample data
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
