logo Use CA10RAM to get 10%* Discount.
Order Nowlogo
(5/5)

In this assignment you will be working with data on student enrollment in classes of the Boston School of Magic.

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Data and program overview

In this assignment you will be working with data on student enrollment in classes of the Boston School of Magic. The data includes

  • A list of courses included in two certificate programs of the school (descriptions of programs provided in txt and program2.txt)

  • Course prerequisites structure (txt)

  • Class lists, including grades, for students who took these courses in the past as well as those who are taking the courses now (2019-20). Each class list comes in a separate file, the first line of which includes the course number, preceded with letter ‘c’, e.g. Each such file stores records of students who were/are enrolled in course number 1250. (those files that contain -1 instead of a grade are current semester files, for which grades have not been posted yet.)

There is a lot of useful information that can be derived from this data, such as, how many students are eligible for a diploma in each of the two programs, etc. In this assignment, you will be creating a program that uses this data to estimate the number of students who would be eligible for taking a specific course. An

eligible student:

  • has completed all prerequisites for the course, and

  • has not taken it in any prior

Boston School of Magic allows students to enroll in any course, regardless of the program.

I provide two data sets for this assignment, in zip files called data-small.zip and data-large.zip. Download and unzip the files in your project folder. Unzipping should result in two folders added to your project folder: files-small and files-large. Review the contents of the files before you start, to familiarize yourself with their structure.

The program that you write must work as follows.

  1. Ask the user to specify the subfolder in the current working directory, where the files are

  2. Ask the user for a course number, outputting the number of eligible students in response. Incorrect course numbers should be ignored and the program should go on. When the user does not specify any course number, pressing enter instead, the program should

The sample interaction demonstrates the running of the program.

Sample interaction

Please enter the name of the subfolder with files: files-small

Enter course number or press enter to stop: 1100

There are   17  students who could take course    1100 Charms. Enter course number or press enter to stop: 2300

There are   2  students who could take course    2300 Care Of Magical Creatures. Enter course number or press enter to stop: 2470

There are   19  students who could take course    2470 Magical Theory. Enter course number or press enter to stop: 45

There are   0  students who could take course    45 None Enter course number or press enter to stop:

 

Important Notes and Requirements

  1. Your program should not use any global variables and should have no code outside of function definitions, except for a single call to main.

  2. All file related operations should use device-independent handling of paths (use getcwd() and

os.path.join() functions to create paths, instead of hardcoding them).

  1. You must define and use functions specified below in the Required Functions You may and should define other methods as appropriate.

  2. You should use data structures effectively to efficiently achieve the goals of your functions and programs.

Required Functions

You must define and use the following functions, plus define and use others as you see fit:

  1. Function processProgramFile(), which will be used to read information about programs and store it in an easily accessible form for retrieval. It must be passed a single parameter of type str, providing the path to a program description file. The function should construct a dictionary based on the information in the file. The dictionary should have keys equal to the course numbers, and values for keys equal to the corresponding course titles, g.

{'1001': 'Transfiguration.', '1100': 'Charms.', '1250': 'Defense Against The

Dark Arts.', '1380': 'Potions.', '1420': 'Arithmancy.', '2075': 'Flying.'}

The function must return a tuple, consisting of the program name and the created dictionary.

  1. Function processPrereqsFile(): This function will be used to read information about the prerequisites structure and store it in an easily accessible form for retrieval. It must be passed a single parameter of type str, providing the path to a file defining prerequisites. The function should construct a dictionary based on the information in the file. A line in the file of the form 1250: 1001 1100 indicates that 1250 has two prerequisite courses: 1001 and 1100. The dictionary should have keys equal to the course number, and values for keys equal to the corresponding prerequisite courses. Only courses that have prerequisites should be included in this

The function must return the constructed dictionary.

  1. Function processClassFiles():This function will help in combining the data about enrollments into courses from multiple files into a single dictionary organized by course number. It must be passed a single parameter, defining the subfolder with the class list files, as outlined in the Data The

function should  construct  a  dictionary with keys corresponding  to  course numbers.  The value for  each key must be equal to the set of students who have taken or are taking the course designated by the key.

The function must return the constructed dictionary.

(5/5)
Attachments:

Related Questions

. Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma

. The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

. Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

. SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

. Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Atharva PatilComputer science

545 Answers

Hire Me
expert
Chrisantus MakokhaComputer science

815 Answers

Hire Me
expert
AyooluwaEducation

515 Answers

Hire Me
expert
RIZWANAMathematics

673 Answers

Hire Me

Get Free Quote!

401 Experts Online