Answered step by step
Verified Expert Solution
Question
1 Approved Answer
suffice to solve the problems. Provided Files File(s) to Submit Background In this programming assignment, you will be the hiring manager of a company, a
suffice to solve the problems. Provided Files File(s) to Submit Background In this programming assignment, you will be the hiring manager of a company, a tech startup based at Fudan. FudanTech is hiring current students and new graduates to fill up their Software Engineer roles. As the hiring manager, you will be responsible for implementing functions that work together to determine if a candidate can be hired, and if so, with what base salary. To be eligible for a software engineer role, a candidate must be interviewed, and assessed with the following five criteria: "Coding Challenge", "Data Structure", "Algorithm", "System Design", and "Behavioral". A raw percentage score is associated with each criterion. Each candidate has a score_list, a list of 5 tuples, where each tuple contains the criteria name as well as the corresponding raw percentage score in string format. An example of score_list is [("Coding Challenge", "66\%"), ("Data Structure", "989"), ("Algorithm", "74\%"), ("System Design", "82\%"), ("Behavioral", "60\%")] . (Ihese criteria may not always be listed in the above order, that is, "Coding Challenge" is not necessarily the first criteria in a candidate's score_list.) Each candidate's information is stored in candidate_info, a list of 4 elements in the following order: - The first element is a string that tells whether the candidate is interviewed for a full-time software engineer role or an internship, so there are only two possible values: "Full-time" or "Intern" . - The second element is a boolean value that tells whether the candidate applied to this position with an internal referral, so a True value means a current employee of FudanTech has recommended this candidate. - The third element is a string that tells the hiring decision for this candidate. This field is currently undetermined (i.e. an empty string "") for a new candidate. The determine_hiring_decision function (see below for implementation details) will update this field to "Strong Hire", "Normal Hire", or "No Hire" based on the candidate's score_list. - The last element is an integer value that tells the base salary per month for this candidate. It is also currently undetermined (i.e. a zero) for a new candidate. The determine_salary function (see below for implementation details) will update this field to a new integer number based on the hiring decision for this candidate. An example of candidate_info of a new candidate is ["Full-time", True, , "n, 0 ], and after you implement and run determine_hiring_decision and determine_salary (these two functions will be called in update_candidate_info), it will be updated to something like ["Full-time", True, "Strong Hire", 16000]. There are a total of 5 functions to implement in this PA. def calculate_rating(raw_percentage_score) def calculate_all_ratings(score_list, candidate_info) def deternine_hiring_decision(all_ratings, candidate_info) def deternine_salary(candidate_info) def update_candidate_info(score_list, candidate_info) Write and test each function in the order presented before moving on to the next function. Since many functions depend on previous functions, this will save you some time when debugging. Here is a dependency diagram of these functions. (An arrow from function A to function B means A is dependent on / makes a call to B.) Starter Code We have provided a starter file hiring_process.py, which contains empty function definitions that return placeholder values (such as return or return ). For functions that have specific return values, you would need to change these placeholder values. Please see below for implementation details. Implementation Details 1. def calculate_rating(raw_percentage_score) In hiring_process.py write the function calculate_rating(raw_percentage_score). In this function we want to be able to convert any given percentage score into a string rating "Excellent"/"Good"/"Fair"/"Bad"/"Fail", and return that rating. The table below outlines what scores correspond to what rating. Notation explanation: square brackets '[]' mean inclusive, and parentheses ' ( )' mean exclusive. For example, [80,90 ) is equivalent to 80=21 means a "Strong Hire", a total hiring score from 16 to 20 (both inclusive) means a "Normal Hire", and a total hiring score =15 means a "No Hire" decision. See the table below. - Special Rule: If the candidate applies for a full-time position, any "Fail" will result in an immediate "No Hire" decision, no matter how well the candidate performed on other parts. Ater calculating the hiring score for the candidate, the function replaces the hiring decision field currently an empty string "') of candidate_info with the corresponding hiring decision. :xample: Example: all_ratings = [("Coding Challenge", "Excellent"), ("Data Structure", "Excellent"), ("Algorithm", "Fair"), ("System Design", "Good"), ("Behavioral", "Bad")] candidate_info = ["Full-time", True, "", e] After calling determine_hiring_decision with these arguments, candidate_info becomes ["Full-tine", True, "Normal Hire", 0] Explanation: The total hiring score is 18=5 (Excellent) +5 (Excellent) +3 (Fair) +4 (Good) +1 (Bad), and there isn't any "Fail" rating for this full-time job applicant. 4. def determine_salary(candidate_info) In hiring_process.py write the function determine_salary(candidate_info). This function takes in a candidate's information as the argument, and it doesn't return anything. It should simply update the salary field of candidate_info in place based on the hiring decision for the candidate. - If FudanTech decides not to hire the candidate ("No Hire"), we should not even determine the salary. You can assume that a hire is the prerequisite for calling this function. - No matter whether it is a strong hire or a normal hire, an internship position always has a fixed salary of $5,000 per month. - If the candidate applies for a full-time position, a normal hire gives the candidate a monthly base salary of $9,000, and a strong hire would increase this value by $1,000. Examples: candidate_info_A = ["Full-time" , True, "Nornal Hire", 0] candidate_info_B =[ "Intern", False, "Strong Hire", ] After calling determine_salary with the above examples as the argument, they become: candidate_info_A = ["Full-time", True, "Nornal Hire", 900e] candidate_info_B =[ "Intern", False, "Strong Hire", 5000] 5. def update_candidate_info(score_list, candidate_info) In hiring_process.py write the function update_candidate_info(score_list, candidate_info). This function first calculates a list of ratings based on the candidate's scores on the five assessment criteria, and then determines (updates) the hiring decision for the candidate using the rating list. If FudanTech decides to hire the candidate in the end, the function will also determine (update) the base salary for the candidate. You should make calls to the functions you specified earlier to do the above tasks. The function returns nothing. Example: score_list = [("Coding Challenge", "69s"), ("Data Structure", "959"), ("Algorithm", "769"), ("Systen Design", "889s"), ("Behavioral", "64s")] candidate_info = ["Full-time", True,"", ] After calling update_candidate_info with these arguments, candidate_info becomes ["Full-time", True, "Normal Hire", 960e]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started