This project was completed in Python for a Software Design course. Ultimately, the purpose of this program is to allocate engineering students into specific streams based on certain conditions (GPA, department capacity, and free choice elegibility).
The input is a text file containing student id, first name, last name, gender, gpa, [stream 1, stream 2, stream 3], and true/false (free choice). The program reads through this text file and creates a tuple containing the information of a student.
Using the lambda function, the program will determine all the students who are eligible for free choice and have a gpa >= 4.0 (on a 12 point scale). It will give them priority when allocating students into their stream (Assumption: there will be a guaranteed spot for free choice students regardless of department capacity).
Here is an example of the program:
There are 7 test students with their first name, last name, gender, gpa, top choice streams (all students were made to want software as their first choice stream), and whether they have free choice or not.
The use of the lambda function, as shown in the second image above, is to return a list of all the students who had free choice ("True" at the end of their student information).
As you can see in the third image, despite students 3, 4, and 5 having a higher gpa than student 7, student 7 was accepted into the Software stream due to free choice. Students 3, 4, and 5 were allocated to their second choice stream; chemical. For student 6, since they did not have free choice and the other two departments had reached their maximum capacities, he was allocated into the next available stream he was eligible for (materials).
All source code is available upon request.