CISC105 - General Computer Science
Program #2
File I/O
- Goals
This program is an exercise to familiarize you with the C Language concept of File I/O.
You will need to perform the following:
- Create (edit), compile (debug), and execute a C program.
- Facilitate the concepts of File I/O.
- Create a script which includes the following for the program:
- Concatenation of the source code.
- Compilation of the source code.
- Execution of the completed bug-free program.
- Concatenation of the file used by this program.
- File I/O Exercise
Create a program that performs the following facilitating the use of File I/O:
- Reads the ten employee records (structures) from the file created in Program #1
- employee number
- employee name
- hours worked
- pay rate
- Displays the records to the screen with a gross pay calculated from hours worked and pay rate
- Displays totals for hours worked and gross pay; and averages for hours worked, pay rate, and gross pay
- Sort the records in ascending employee name order.
- More than one function must be used (main, input, output, sort).
HINT: Check out the "strcmp" function in the book to sort by employee name.