Write a C program that can be used as a database of student’s information for the statistics and
computer science department. Populate the database with 10 records. The program should be able to
dynamically allocate or deallocate storage for the student’s records using linked lists.
The database should have the following fields: the first and last names, a course code, and a marks for a
The program should display the following menu:
Welcome to the database menu!
Press 1 to insert a new record
Press 2 to modify a record
Press 3 to delete a record
Press 4 to search the database (by last name)
Press 5 to print the student details
Press 6 to find the class average for a course
Press 9 to quit
The insert function should work regardless of the position. Position 0 refers to the position before the
first record. Any position greater than the length of the database should be put as the last position.
(hint : use an additional parameter in the insert function to determine the place(front, rear or next) of
The modify function should be used to search student by last name. If that student is found, all records
associated with that student should be printed (on the screen) and get modified data from the user and
update the data base.
Similarly, the delete position should work for any position. Make sure that it works even when deleting
the first, last or middle records.
The search function should be used to search by last name. If that student is found, all records
CS 202 – Data Structures Practical 2009/10
associated with that student should be printed (on the screen).
Print function should print all the records in the database.
Hint: To compute the class average, first search the field with the course code. Only average those
marks that match the proper course code.
You can use the list processing interface provided and modify the main program in order to proceed
with the assignment.