Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Programming Assignment 2

Student Management System

Problem Description:

In Emperor Penguin University (EPU), every student record contains the following information:

•     First Name

•     Surname

•     Gender

•     ID

•     Age

Among them, the ID is a unique identifier of the student. The complete student list is stored in “studentList.txt”. Please build a student management system for EPU which:

•     Stores all the student records on an AVL tree.

1.     There are in total 31537 records

2.     Please define proper struct to describe a student record

•     Accepts query commands and prints a message for a certain student.

1.     The command for a query is of format: “q”+<ID>. For example, if the user inputs “q29001”, the system should print a message about the student whose ID is 29001.

2.     Follows describes the format of the message.

a)     If the user inputs “q29001”, the system should print “Olivia SWANSON (29001) is a female of age 20.”

b)     If the user inputs q26870”, the system should print Zyn STARK (26870) is a male of age 21.”

c)      If the user inputs q40000”, the system should print “No records found.”

•     Accepts unenrollment command and removes a certain student from the tree.

1.     The  command for  unenrollment  is  u” +  <ID>.  For  example,  if the  user  inputs “u29001”, the system should remove the student record whose ID is 29001.

2.     A message is printed after unenrollment.

a)     If the user inputs “u29001”, the system should print “Olivia SWANSON (29001) is unenrolled.”

b)     If the user inputs “u40000”, the system should print “No records found.”

3.     You don’t have to write the information back into studentList.txt”.

•     Accepts the exit command and exits the program. The exit command is “e”.

You need to submit three files on iSpace:

➢  SMS.h: the header file which declares the data structures and the functions for the student management system.

➢  SMS.c: implements the functions defined in SMS.h

➢  main.c: the main function which runs the main procedure.

Note:

     Make sure your code is C code that works correctly with a C compiler, not C code that only

works with a C++ compiler!

     Make sure that an AVL tree is used for SMS, and every node of the tree stores one student

record.

     You may assume that the .txt file is in the same directory as your program does.      You may assume that the user command is always valid.