Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions