Interns

Introduction

In this homework you will practice

General Instructions

This is an individual assignment.

Collaboration at a reasonable level will not result in substantially similar code. Students may only collaborate with fellow students currently taking this course, the TAs and the lecturer. Collaboration means talking through problems, assisting with debugging, explaining a concept, etc. You should not exchange code or write code for others.

Notes:

Problem Description

Congrats! You are the Supply Chain Manager at a major company, and you’re tasked with deciding your intern team for the Summer. Luckily, HR has summarized applicant data for you, and your job is to decide whom to hire and their offer details.

Solution Description

HR provies you with CSV and JSON files containing candidate information:

Create a module called interns that reads these data files and generates rankings of candidates for use in hiring decisions. Your module should define a Candidate class which includes/overrides the following methods:

In addition to the Candidate class, include the following functions:

When the interns module is imported as a module it should only make the class and function definitions described above. When the interns module is run as a script it should take two mandatory and one optional command line arguments. The first command line argument is the name of a CSV file organized exactly like academics.csv, the second command line argument is the name of a file organized exactly like interviews.json, and the third (optional) command line argument is a ranking criterion. The interviews JSON file should contain interview scores for all the students in the academics CSV file. When the script is run without the third command line argument, the students are printed in order as ranked by their composite scores. If the third command line argument is given, it should specify one of the other rank orders from the module functions listed above: academics, technical, or behavioral. If the user supplies a third command line argument that is not one of the specified rank order options, print the students ranked by composite score.

Example script runs:

$ python interns.py academics.csv interviews.json
id              name                         gpa cs2316grade technical  behavioral
aramathorn3     Ramathorn, Arcot             3.9          A         10         10
jchimpo39       Chimpo, Johnny               4.0                    10         10
uhanson3        Hanson, Ursula               4.0                    10         10
johagen3        O'Hagen, John                3.0          C         10          7
jfoster3        Foster, Jeff                 3.6          B          6          9
mwomack3        Womack, MacIntyre            2.9          C          7          9
rroto3          Roto, Robert                 2.8          B          7          8
ljoshnson3      Johnson, Larry               3.2                     7          9
bgrady3         Grady, Bruce                 1.9                     8          5
fgalikanokus3   Galikanokus, Frank           2.0                     6          5
rfarva3         Farva, Rodney                2.1                     5          4
ssmy3           Smy, Samuel                  2.8                     4          4
jrando3         Rando, Jim                   2.0                     4          4
jburton3        Burton, Jack                 2.9                     4          3

$ python interns.py academics.csv interviews.json academics
id              name                         gpa cs2316grade technical  behavioral
aramathorn3     Ramathorn, Arcot             3.9          A         10         10
jfoster3        Foster, Jeff                 3.6          B          6          9
rroto3          Roto, Robert                 2.8          B          7          8
johagen3        O'Hagen, John                3.0          C         10          7
mwomack3        Womack, MacIntyre            2.9          C          7          9
jchimpo39       Chimpo, Johnny               4.0                    10         10
uhanson3        Hanson, Ursula               4.0                    10         10
ljoshnson3      Johnson, Larry               3.2                     7          9
jburton3        Burton, Jack                 2.9                     4          3
ssmy3           Smy, Samuel                  2.8                     4          4
rfarva3         Farva, Rodney                2.1                     5          4
fgalikanokus3   Galikanokus, Frank           2.0                     6          5
jrando3         Rando, Jim                   2.0                     4          4
bgrady3         Grady, Bruce                 1.9                     8          5

$ python interns.py academics.csv interviews.json technical
id              name                         gpa cs2316grade technical  behavioral
johagen3        O'Hagen, John                3.0          C         10          7
aramathorn3     Ramathorn, Arcot             3.9          A         10         10
jchimpo39       Chimpo, Johnny               4.0                    10         10
uhanson3        Hanson, Ursula               4.0                    10         10
bgrady3         Grady, Bruce                 1.9                     8          5
rroto3          Roto, Robert                 2.8          B          7          8
mwomack3        Womack, MacIntyre            2.9          C          7          9
ljoshnson3      Johnson, Larry               3.2                     7          9
jfoster3        Foster, Jeff                 3.6          B          6          9
fgalikanokus3   Galikanokus, Frank           2.0                     6          5
rfarva3         Farva, Rodney                2.1                     5          4
jrando3         Rando, Jim                   2.0                     4          4
ssmy3           Smy, Samuel                  2.8                     4          4
jburton3        Burton, Jack                 2.9                     4          3

$ python interns.py academics.csv interviews.json behavioral
id              name                         gpa cs2316grade technical  behavioral
aramathorn3     Ramathorn, Arcot             3.9          A         10         10
jchimpo39       Chimpo, Johnny               4.0                    10         10
uhanson3        Hanson, Ursula               4.0                    10         10
jfoster3        Foster, Jeff                 3.6          B          6          9
mwomack3        Womack, MacIntyre            2.9          C          7          9
ljoshnson3      Johnson, Larry               3.2                     7          9
rroto3          Roto, Robert                 2.8          B          7          8
johagen3        O'Hagen, John                3.0          C         10          7
fgalikanokus3   Galikanokus, Frank           2.0                     6          5
bgrady3         Grady, Bruce                 1.9                     8          5
rfarva3         Farva, Rodney                2.1                     5          4
jrando3         Rando, Jim                   2.0                     4          4
ssmy3           Smy, Samuel                  2.8                     4          4
jburton3        Burton, Jack                 2.9                     4          3

Don’t worry about ties, and don’t worry about error checking.

Tips and Considerations

Grading

TBD

Submission Instructions

Attach your interns.py file to your Canvas assignment submission.

Verify the Success of Your Submission to Canvas

Practice safe submission! Verify that your HW files were truly submitted correctly, the upload was successful, and that your program runs with no syntax or runtime errors. It is solely your responsibility to turn in your homework and practice this safe submission safeguard.