Linked List – Strings – Problem #1
IIT Kharagpur CS10001 / CS11001 Programming and Data Structures Lab Question Archive
Problem Statement
Write a C program to build the following software: Student Academic Record Management Software: Write the following functions to implement a student academic record management software. Define the following variables with global scope: A structure named student consisting of: Roll (unsigned int), first name of student (20 characters), last name of student (20 characters) and cgpa (float). slist: A pointer to a linked list of student structures. a) main: In an infinite loop, display the following menu, and then prompt the user to enter a number between 1 to 7. Menu Choice: 1. Enter student details 2. Delete student details 3. Display student details 4. Edit student grade 5. Sort student list 6. Show statistics 7. Exit Depending on the user input, carry out the following: 1. Call the function enrolStud 2. Call the function deleteStud 2. Call the function displayStuds 3. Call the function editStudGrade 4. Call the function sortStuds 5. Call the function showStats 6. Exit b) enrolstud: The user would enter the details of one student. An appropriate structure should be created and inserted into the linked list slist, taking care to keep the linked list in a sorted order based on roll number. The roll numbers are assumed to be unique. [5 Marks] c)deleteStud: Prompt the user to enter a student roll number and check if the corresponding student is present in the linked list. If it is present, then delete the node corresponding to the student. After that display the details of all the students in proper format.[5 Marks] d) displayStuds: Display the details of all student present in the list in proper format. [5 Marks] e) editStudGrade: Prompt the user to enter a student roll number and check if the corresponding student is present in the linked list. If it is present, then display the details of the student. Otherwise, display "Student not present in the list." If the student is present, ask for the revised grade. Display the updated grade of the student. After that display the details of all the students in proper format.[5 Marks] f)sortStuds: This procedure should sort the linked list based on the CGPA of the students. If two students are having same CGPA, it should sort them based on their roll number. Finally, it should display the students in the list nicely formatted. [Hint: You may create a linked list, tlist create and insert nodes corresponding to slist. Finally, deallocate the nodes of the list slist, and copy the link tlist into slist.] [5 Marks] g) showStats: Display the minimum CGPA, maximum CGPA, and the details the corresponding students. Also display the average CGPA. [5 Marks]