Assigning students to laboratory classes. Possibility of clashes ignored. 60 students enrolled on the course. You must assign each student to one of six different classes, taking into account the capacity of each class. Each student has four choices, none of which are guaranteed to be satisfied.
You need two files for the input to your program.
- A file called "[url removed, login to view]", contains details of the 60 students. Each student record has a surname of type string, a forename of type string, and their four choices of lab session, each option an integer, separated by spaces on a single line. A couple of records from the file might look like this:
1 3 4 2
4 6 5 2
which means that George Lewis' first choice of lab session is session number 1, then session number 3 etc.
- A file called "[url removed, login to view]". This contains details of the six lab classes to which the students must be assigned. Each lab class record has a number, of type integer, a day, of type string, a time, also of type string and a capacity, an integer. A couple of records:
which means that lab class one is at 1:30 on Mon. and can sit no more than 18 students.
Job is to read in the data, store them in appropriate data structures and then assign students to classes, ensuring that no class has more students than it can sit. You must then pring out a class at a time to the screen, detailing the lab class number, the day and time, an alphabetical list of the students assigned to that class, and a misery factor for that class. Your program should stop after printing each class' details so that the user can read the information provided. The misery factor of a class is the sum of the misery factor for each student in that class. Each student's misery factor is calculated:
- student assigned to 1st choice, misery factor 0
- student assigned to 2nd choice, misery factor 5
- 3rd choice, factor 10
- 4th choice, factor 15
- none of his choices misery factor 20
You may assume that the files are in the described format, that they exist and that there are no typing errors. You may assume that no class has a capacity of more than 15 students. If you make any other assumptions you must explain them in the form of comments at the top of your code.
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2) Installation package that will install the software (in ready-to-run condition) on the platform(s) specified in this bid request.
3) Exclusive and complete copyrights to all work purchased. (No GPL, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site).