CISC105 - General Computer Science
Lab #7
Structures
- Goals
This lab is an exercise to familiarize you with the C Language concept of Structures.
You will need to perform the following:
- Create (edit), compile (debug), and execute a C program.
- Facilitate the concepts of Structures.
- 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.
- Structure Exercise
Create a program that performs the following facilitating the use of structures:
- Accepts ten employee records (structures) from the screen
- employee number
- 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 number order
- More than one function must be used (main, input, output, sort, etc.)
Please enter the following records in the order shown:
EMP# HOURS RATE
===== ====== =====
2173 40 5.00
6925 37 5.25
4732 20 7.25
8641 40 8.25
9732 40 25.00
1378 25 9.50
5937 36 10.00
4188 38 15.00
5264 40 12.75
3343 30 13.00