Question: def weighted _ PAs ( ? ) : # you have to determine the signature. [ 5 points ] Description: Design and write a function

def weighted_PAs(?): # you have to determine the signature. [5 points] Description: Design and write a function called weighted_PAs()that finds the weighted average score of programming assignments for a student. The function accepts a list of integers (grades) and the number of lowest PAs that need to be dropped (drop). After dropping the 'n' lowest grades, it computes the average as the sum of grades divided by (length of grades drop) and returns a float specifying the weighted score. The weight is 40% Parameters: grades (list of int), where each score inside the grades is between 0 and 50(inclusively). drop (int) This indicates how many lowest scores are dropped. If this parameter is not provided, no grades are dropped. (Refer to the examples below to find the order)3 Assumptions: length of grades >=1; and length of grades >drop Return value: A float specifying the weighed score for programming assignments. Note: All floating point output values were rounded to 2 spaces after the decimal point using the round() function, round(data,2). However, do not use these rounded values for your calculations, only round when you return them, otherwise your output will lose precision. Examples: weighted_PAs ([40,10,35,5],1)22.67 # Drop [5]; avg=(40+10+35)/(4-1)=28.3, weighted =22.67 weighted_PAs ([30,20,50])26.67 # No Drop; avg=(30+20+50)/(3-0)=33.3, weighted =26.67 weighted_PAs ([50]))40.0 def weighted_exams(?): # you have to determine the signature [5 points] Description: This function takes two midterm exam scores and a final exam score, all of which are integers. If the parameter values for the midterm exams are not provided, the final exam score will be substituted for them. If the final exam score is not provided, its value will be zero. The function returns a list of three floating-point values representing the weighted scores of each exam. The weighted scores for midterm exams is 15%, and for the final exam is 30%. Parameters: Refer to the examples below to find the names of the parameters and their order in the function signature. Return value: A list of three floats that are the weighed scores for each midterm and the final exam, [wmt1, wmt2, wfe] Assumptions: All the exam scores are between 0 to 100(inclusively). Examples: weighted_exams (100,100,100)[15.0,15.0,30.0] weighted_exams (mt1=50)[7.5,0.0,0.0] weighted_exams (fe =85, mt1=0)[0.0,12.75,25.5] def finalGrade(names, PAs, exams): [8 points] Description: This function takes a list of students' names, a tuple containing the list of PA grades and the number of grades to drop, and a list of dictionaries with exam scores for each student. It calculates the final grade for each student and stores it in a dictionary where the keys are the students' names and the values are their final grades. This function MUST be implemented by calling the weighted_PAs and weighted_exams functions. The final grade is the sum of the weighted exam scores (60% in total) and the weighted PAs (40% in total).4 Parameters: names, a list of strings indicating the students' names. PAs, a tuple of lists, where each list contains the list of grades earned for each PA, followed by the number of grades that need to be dropped for a student. exams, a list of dictionaries, where each dictionary contains the exam scores each student obtained. The keys of this dictionary are always 'fe','mt1', and 'mt2', but they may appear in different orders in the dictionary Return value: A dictionary that shows the names of students as keys and their final scores as values. Assumptions: All the PAs gardes are between 0 and 50 and all the exam scores are between 0 to 100(inclusively). The lengths of names, PAs, and exams are all equal. Examples: finalGrade(['John'],([[50,48,25,45]],),[{'fe' : 100,'mt1': 90,'mt2': 100}]){'John': 92.1} finalGrade (['John', 'Mason'],([[5,8,0],2],[[50,30,40,45],2]),[{'fe' : 100,'mt1': 90},{'mt1':10,'fe':50,'mt2':80}]){'John': 64.9, 'Mason': 66.5} finalGrade (['Rose', 'Tom', 'Paul'],([[50,12,40],1],[[10,10,30,30,40],2],[[40,14,15,50,50,36],3]),[{'fe' : 100},{'mt1': 100,'mt2':50},{}]){'Rose': 96.0, 'Tom': 49.17, 'Paul': 37.33}

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 Programming Questions!