Problem Statement
For this lab, we’ll use the two-dimensional table , call it ‘employees’, shown below. Don’t include the headings in your array, of course, they’re there for explanatory purposes.
Employee Number Monthly Pay
5 1050
17 1200
12 1225
23 1300
6 1140
3 1110
4 1420
1 1360
14 1225
11 1380
10 1410
2 1565
8 1445
7 1387
9 1128
16 1488
For this lab, your job will be to write a program that sorts a table like the above on the two fields ‘Employee Number’ and ‘Monthly Pay’. Sort first on Employee Number, then, within each Employee Number sort on Monthly Pay. Use any sort, quick, bubble. Write a function called ‘sortem()’ that does the actual sorting. It should be displayed in a format similar to that above. The data shown is just for your own testing purposes. To ensure that your program works with other data, you may want to test it on some data you make up. Assume in your program that the maximum size that will be needed for the employees table is 16-by-2, i.e., ‘employees’ should be declared as shown below:
short employees[16][2];
You can also use parallel arrays to the sorting.
0