Lab 13

For this week's lab we wish to implement a waiting list for a course.  We will do this with a list of students, where we store the email, netid, and UIN for students, and the first student to register is the first one who gets added to the course.

The code we've given you should look somewhat familiar, it's got a Node struct, and a function which prints out the entire list.  I've used a different struct, because I've got different data, but the form is the same.  You may use your own structs, and rewrite the print method to match the form of your new struct, as long as the same data gets stored.  Similarly, main is only there as an example of how the functions might be used, and can be modified as you wish, function calls included as long as the parameter types remain the same.  Feel free to look at the previous lab examples and your solution from last week.

With the example in main that I've given you, this is the output I produce.

 List contains: ee ddd cc bbbbb aa

Student D is waiting on 4 slots to open.

Student A is waiting on 1 slots to open.

Student C is waiting on 3 slots to open.

Student A@uic.edu       aa      111111111 added to Course

Student B@uic.edu       bbbbb   222222222 added to Course

Student C@uic.edu       cc      333333333 added to Course

Student D@uic.edu       ddd     444444444 added to Course

 List contains: ee

Student E@uic.edu       ee      999999999 added to Course

 List contains:

Feel free to modify main as you wish (for example, if you want to pass the tail of a list as opposed to the head to a function).

Notes:

Submission:

1. You should work with a partner for this (and all the remaining) lab(s).  Only one of you need to submit the program to Blackboard, though you should be certain that both of your names be present in a comment at the top of the .c or .cpp source file.

1.5 If you work alone, include just your name in a comment at the top so that I know you worked alone, and not have to guess.

2. You should turn in to Blackboard by the END OF THE LAB.  I know it's tempting to keep working on it, but other classes come in, and it's not fair to the students who are limited to that particular time span if you go over.  Which isn't to say that you can't work on it later, to check your solution against the one I post for your own understanding.  But what you submit for a grade should be before the next hour begins.

3. If you wish, you may submit your lab by noon on Friday for a 1 point penalty.  If you can't finish up the second point by the end of lab, you can still earn the score by completing all three steps and submitting your code by the day after.