Create a simple student database program. You are to have the following structures:
struct Student{
char id[10];
char fname[30];
char mname[30];
char lname[30];
char course[50];
int age;
int year;
};
struct subject{
Student students[40];
char name[20];
int size;
};
The first will represent a student's record. The second a particular class.
You are going to create just one class/subject. Prompt the user the following menu:
Menu:
1. Enroll
2. Drop
3. Sort by ID
4. Sort by Name
5. Display by Year
6. Display by Name
7. Display by ID
8. Exit
All these items, except of course for Exit, must be implemented using a function. You must also include a function that searches an ID, a name. Display functions should also be implemented, one for a particular student, and another for the entire class/subject.
For enroll, you must first check if the student/ID number already exists in the class. If that is the case, report a message that the student is already enrolled in the class. This is of course a separate check from the class size.
For Drop, check first if the student exists in the class. Report a no such student message if otherwise.
For the search functions, you will have to do comparisons between two strings. The function strcmp from the string.h library can be used. But a one point bonus will be given to you if you create your own comparison function. If you are going to use strcpy, you will as well get a bonus point if you will implement your own version of strcpy.