CS360: Exam 1: 10/22/97. Grading of Question 4
Part 1 was worth 6 points. Point allocation was as follows:
- It reads names and social security numbers and prints them out
sorted: 2 points
- It prints them in the form SSN, name: 1 point
- It reads from the file inputfile: 1 point
- Each entry from inputfile consists of an integer (stored as
a raw int) containing the number of letters in the name, then the
name, then 11 bytes containing the ssn: 2 points
Part 2 was worth 10 points. Two were if you said that there were too
many system calls, and that you needed to add buffering.
What you wrote needed to make sense. If you said "you're making too
many system calls. You can reduce the number of system calls by making
procedure calls", then you lost a point because simply making procedure
calls does not help. You need to make procedure calls that perform buffering.
This is subtle, but important.
The remaining 8 were for the code.
Some of you did two levels of buffering. You used fread to read
into a large chunk of memory, and then read from that large chunk. If
you did this, you lost 2 points because it is bad coding. fread()
performs buffering for you -- so why put buffering on top of it? This
is actually less efficient than simply calling fread() and much
harder to read (and write) as well.
Histogram of scores