Question: Linked List in C Your program must:: Compile on GCC 5.3 or greater under an Ubuntu based Linux distribution (e.g., Xubuntu). Have an enumeration type
Linked List in C
Your program must::
Compile on GCC 5.3 or greater under an Ubuntu based Linux distribution (e.g., Xubuntu).
Have an enumeration type (called Subject) to represent subjects ("SER=0, EGR=1, CSE=2, EEE=3").
Have a struct type (called CourseNode) to hold information about a course. Include a subject (see enum type above), a number (int), a teacher (a string of length 1024), and credit hours (int). It should also include the variables necessary to represent a linked list.
Use a linked list of structs (called course_collection) to store course information. Your program will allow the user to enter any number of courses - this means you must use dynamic memory allocation to store the courses. When a user adds a course, a new node must be created, and when a course is removed, its corresponding node is removed. Note: your program may not exactly match the outputs below - screen shots are only provided as samples. Points allocation is:
Update the main menu to display the total number of credits each time it is shown. [4 points]

The program must not leak memory on exit. [2 points]
Create a void course_insert() function that adds courses to the collection and keeps it sorted by the course number (e.g. 240). Sorting by subject is not required. Populate the elements of the CourseNode as shown below.

Properly allocate memory when removing nodes. No memory leaks. [4 points]
Create a void schedule_print() function. This function will display the contents of the course_collection list with format Subject Number Credits Teacher as shown. (Hint: Use a switch statement to map from a enumeration to a printf.) [5 points]

Create a void course_drop() function. This function will prompt the user for a course by its number. It then searches for the course in course_collection and removes it. If more than one course matches, then drop only the rst occurrence. Dropping a course is only allowed if the course exists in the collection, otherwise an error message will be displayed. [8 points]

Properly deallocate memory when removing nodes. No memory leaks. [4 points]
Terminal -ruben@ruben-VirtualBox:-/Desktop File Edit View Terminal Tabs Help ruben@ruben-VirtualBox:-/Desktop$ /scheduler Welcome to ASU Class Schedule Menu Options : Add a class : Drop a class : Show your classes Quit Total Credits: Please enter a choice 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
