Question: Write a python module called ReadAllocationData.py and define the following functions: 1. readStdnts(s) that takes a string s corresponding to a filename and returns a

Write a python module called ReadAllocationData.py and define the following functions:

1. readStdnts(s) that takes a string s corresponding to a filename and returns a list of dictionaries of student information. Each dictionary in the list corresponds to one student. The dictionary for each student will have the following form: {macid: string, fname: string, lname: string, gender: string, gpa: float, choices: [string, string, string] }. You are free to determine the format of the text file that stores this information. The fields in the dictionary correspond to the following concepts respectively; macid is a short alphanumeric string, first name, last name, gender can be 'male' or 'female', their grade point average (scale from 1 to 12) and preffered choices from the following options (civil, chemical, electrical, mechanical, software, materials, engphys). The choices are represented by a three entry list of strings, where each string corresponds to the type of engineering they would prefer to study.

2. A function named readFreeChoice(s) that takes a string s corresponding to a filename and returns a list of strings, where each entry in the list corresponds to 2 the macid (string) of a student that has been granted free choice. (Free choice is a status that is granted to incoming Engineering students that have a sufficiently high highschool average.) The students on this list are automatically allocated to their first choice of program, as long as they are eligible. (The allocation algorithm is responsible for determining eligibility; the current function does not filter the incoming names in any way.) The information needed is in the test file that corresponds to the name given in the argument s. You are free to determine the format of this file.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!