CIT 594 Assignment 9: Registration Madness
Spring 2013, David Matuszek

Purposes of this assignment

General idea of the assignment

Registration for courses at Wossamatta U. is done electronically. Because there is contention for the most desirable courses, the instant that registration opens, all the students try to register for courses. The lucky ones get all their courses; the very unlucky ones may not get any courses they want. However, there is enough room for all students to get the required three courses.

Your assignment is to write a complete simulation of 500 190 students trying to register for 24 offered courses. When the simulation is complete, print out some statistics about the result--how many students got their desired courses, etc. Also print out the total time that your program takes (should only be several seconds.)

Problem details

To avoid getting tangled up in a lot of "real life" details, we will assume a lot of uniformity. For example, all classrooms are the same size.

Programming details

Thread pools

For this program, it makes sense to use a Thread for each student and a Thread for each section (190 threads). Since threads are expensive to create, it is probably better to use a smaller number of threads, and recycle them. Java provides a thread pool for this purpose. Here's a basic outline of how to use a thread pool:

See Executor and ExecutorService in java.util.concurrent for more details.

Due date

Your program is due before 6am Thurdsay, April 25. Zip up the entire directory for this project, and submit via Canvas.