Professional Documents
Culture Documents
Programming Quiz
Programming Quiz
Scenario:
You have been assigned the task of creating a Linked List Management System for a student database.
The system will be used to store and manage information about students, such as their names, IDs, and
grades. As part of your assignment, you need to implement various operations on a singly linked list data
structure using C programming.
Instructions:
Create a function named addStudent that adds a student to the linked list. This function should
prompt the user to enter the student's details and insert the student at the end of the list.
Create a function named removeStudent that removes a student from the linked list based on
their student_id.
Create a function named displayStudents that displays the details of all students in the linked
list.
Create a function named searchStudent that searches for a student in the linked list based on
their student_id.
Create a function named countStudents that counts the number of students in the linked list.
Create a menu-driven program that allows the user to perform the following actions:
Add a student.
Remove a student.
Display all students.
Search for a student.
Count the number of students.
Sort the students based on their names or grades.
Update the details of a student.
Exit the program.
Test the Linked List Management System:
Create a few sample students and add them to the linked list.
Test each operation by selecting the respective option from the menu.
Ensure that the system behaves correctly by adding, removing, displaying, searching, and
counting students as expected.
Note: While implementing the linked list, ensure that you handle edge cases appropriately. For example,
what should happen if a student is not found in the list? Also, consider how the program should handle
duplicate student IDs.