August
1999 QUESTION 2 Total Marks: 20 Marks |
Click here to access other
questions
Click to access |
You are to implement
a student record database system for an Information Technology course. The system stores
one record per student per course. There are four different subjects on the course :
C programming (denoted by CA), Pascal Programming (denoted by AP), C++ programming
(denoted by CPP) and Java programming (denoted by JPP).
|
||
(a) | Define a suitable enumerated type type,
subject_type, which takes on the value of any of the four subject types denoted.
|
[1] |
(b) | Declare a suitable data structure
StudentRecord, for each student, which is capable of holding the following information:
|
[5] |
(c) | Given the definition of the double linked list
which you are to use for storing your records : typedef
struct { Write a function
|
[4] |
(d) | Write a function StudentRecord*
remove_candidate(int mark); that will take in the value of a mark, and remove and
return the first occurrence in the list that it finds of a candidate scoring that
mark. If no candidate is found scoring that mark, the function will return NULL.
|
[6] |
(e) | Write a function sort_list, that takes a
pointer to the list x, and a pointer to an empty list y, and, starting at the maximum mark
of 60 and decreasing to the minimum mark of 0, will perform a sort. Each
element matching the current mark should be removed from the original list, and added to
the new list. The result will be that the list y will contain all of the records which
were in x, but in decreasing order of marks.
|
[4] |