Description
A high school is holding an annual academic competition. Each participating students are
required to take 5 tests. Three of them are standard tests: mathematics, physics and chemistry.
Two are advanced tests. Though all three subjects have advanced tests, each student is required to
take two only. The testing result have been collected and ordered by the time of their registration.
The file name is lab11.dat.
The competition will give out 4 different awards. They are the overall Academic Achievement
Award and three subject awards: Mathematics Award, Physics Award and Chemistry Award.
The Academic Achievement Award is the most prestigious and the winners are not eligible for
the subject awards. However, a student can win multiple subject awards. The award selection
rules are given below.
Academic Achievement Award:
1. The 5 students with the highest total scores are the winners.
2. The total score is the sum of 3 standard scores and 2 advanced scores.
3. In case of tie, the student who register earlier will be given a higher priority.
Subject Awards (Mathematics Award, Physics Award and Chemistry Award):
1. Only those students taking advanced subject tests are eligible for the subject award.
For example, if a student taking Mathematics and Physics advanced tests, then he/she
is eligible for Mathematics and Physics Awards.
2. The 5 students with the highest subject scores are the winners. The subject score is
the sum of the standard test and the advanced test scores.
3. In case of tie, the student who register earlier will be given a higher priority.
4. Students who win the Academic Achievement Award are not eligible for the subject
awards.
Your assignment is to write a C program to process the testing result and print out the award
winners. The structure to store the students’ information is given in the file lab11.h. You must
use this header file. The structure as well as the enumeration type needs to be used as much as
possible to improve the legibility.
The content of the file lab11.dat is consist of 100 lines with each line representing a student.
Again, these students are ordered by their registration time. The information on each line are:
firstName lastName mathScore physScore chemScore ap1Subj ap1Score ap2Subj ap2Score
where:
firstName: first name of the student,
lastName: last name of the student,
mathScore: score of the standard Mathematics test,
1
physScore: score of the standard Physics test,
chemScore: score of the standard Chemistry test,
ap1Subj: subject of the advanced test 1,
ap1Score: score of the advanced test 1,
ap2Subj: subject of the advanced test 2,
ap2Score: score of the advanced test 2.
For example, the first line of lab11.dat file is
Isabella SMITH 70 71 73 phys 66 chem 61
Isabella Smith scores 70, 71 and 73 in the standard Mathematics, Physics and Chemistry tests,
and she took Physics advanced test to get a score of 66, and advanced Chemistry test to get a
score of 61.
Example of the program output is shown below.
$ ./a.out < lab11.dat
Academic Achievement Award Winners:
Elizabeth ANDERSON 466
Xxxx XXXXX …
Xxxxxxxxx XXXXXX …
Xxxxxxxx XXXXXX …
Xxxxx XXXXXXXX …
Mathematics Award Winners:
Taylor RODRIGUEZ 196
Xxxxxx XXXXXXXX …
Xxxxxx XXXXX …
Xxxxxx XXXXXXXX …
Xxxxxx XXXXXX …
Physics Award Winners:
Xxxxxxxxx XXXX …
Xxxxx XXXXXX …
Xxxxxxx XXXXXX …
Xxxxxx XXXX …
Xxxxx XXXXXXXX …
Chemistry Award Winners:
Xxxxxxx XXXX …
Xxxxx XXXXX …
Xxxxx XXXXX …
Xxxxxxx XXXXXX …
Xxxxxx XXXXXX …
2
Notes.
1. Create a directory lab11 and use it as the working directory.
2. Name your program source file as lab11.c.
3. The first few lines of your program should be comments as the following.
/* EE231002 Lab11. Academic Competition
ID, Name
Date:
*/
4. After you finish verifying your program, you can submit your source code by
$ ∼ee231002/bin/submit lab11 lab11.c
If you see a ”submitted successfully” message, then you are done. In case you want to
check which file and at what time you submitted your labs, you can type in the following
command:
$ ∼ee231002/bin/subrec
It will show the last few submission records.
5. You should try to write the program as efficient as possible. The format of your program
should be compact and easy to understand. These are part of the grading criteria.

