The objective of this Programming Project is for students to write a C Program and to apply their knowledge of working with Pointers to structures and performing operations on a Sorted Linked List.

Program Description

Write a C program that performs various operations on a Sorted Linked List that holds the records of students as struct data type.

Your Program should include following key points:

1. Program must have header comments stating the author of the Program, date, and Program Description.

2. The student struct data type will be same as in Lab13a. The nested struct structure is again provided here:

struct date
{
int day, month, year;
};

struct student
{
int studentId;
char studentName[30];
float gpa;
struct date dt_of_reg;
struct student *next;
};

3. All Sorted Linked List Operations of Lab 13-Addendum have to be performed on student records with the nested struct declaration as given in Point 2 above.

4. Program should have all 6 Menu Options: 5 menu options as in Lab13-Addendum and an additional menu option to modify student record. So, program will have following menu options (Order of Menu options does not matter!!):

Students Records operations - Menu Option
*****************************************
1. Insert a New Student Record
2. Print all Student Records
3. Delete a Student Record
4. Count Student Records
5. Modify a Student Record
6. Quit
Enter Choice(1-6):

5. The program should contain following functions ():

void insertStudentNode();
void printStudentNodes();
void countStudentNodes();
void deleteStudentNode();
void modifyStudentNode();
struct student *getStudentNode()

Functions insertStudentNode(), printStudentNodes(), countStudentNodes(), deleteStudentNode(), and getStudentNode() are similar to their counterparts in Lab13-Addendum. Only struct definitions are different and hence the way their student records are accepted and displayed is different. Linked list traversal and other operations remain same.

Only different function that will requires coding:

modifyStudentNode()

Steps to be performed in this function:

  • If the Linked List is empty, print "Student List does not contain data".
  • This function will ask the user for the StudentId, whose details need to be modified.
  • The Sorted Linked List is searched for the StudentId entered by the user.
  • If it is not found, then "Student Id not found" message is displayed.
  • If the StudentId is found, then current values for that StudentId are displayed.

After that the user is asked to enter the modified values for that particular Student Id. (Everything other than Student Id can be modified).

Sample Run of only this menu option is provided here:

Students Records operations - Menu Option
*****************************************
1. Insert a New Student Record
2. Print all Student Records
3. Delete a Student Record
4. Count Student Records
5. Modify a Student Record
6. Quit
Enter Choice(1-6): 5

Please enter the Student ID you wish to modify: 1

Current values for Student Id 1 are:
Student Name: Oscar
Student gpa: 3.40
Student Date of Registration: 2/2/2020

Enter modified values for Student Id 1 :

Enter modified Student Name: Oscar Wilde
Enter modified Student gpa: 3.5
Enter modified Student Date of Registration: 2/1/2020

6. Add functionality in insertStudentNode() function such that duplicate student records are not entered in the Linked List. If the new Student Id entered by the user already exists, then display following message

"Student ID already exists!! Please enter again!!!"

Remember, since this is an implementation of a Sorted Linked List, all incoming student records will be sorted on their StudentIds.

7. Extra Credit function:

int validateDateOfReg(int, int, int)

This function is optional. You may decide and change its' parameters and return value. This function will validate the date that was entered by user for Date of Registration. Date of Registration should be a Valid Date. Also, it should not be greater than todays date and not before the year 2010.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.