Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Make a function called gradeBookwith one parameter which is a list of dictionaries. You can expect the general form of the list of dictionaries as

  1. Make a function called gradeBook with one parameter which is a list of dictionaries. You can expect the general form of the list of dictionaries as follows: [{dict_1}, {dict_2}, ... {dict_n}]. An example argument has also has been presented below:

 

[ { "name": "Emma", "assignments": [10.0,20,30], "projects": [50.0,60.0], "exams": [75,98]},

{"name": "John","assignments": [15, 24, 35, 62.0], "projects": [30, 60],"exams": [40, 70]},...]

 

  1. For each dictionary in the list, compute the average of each activity i.e., assignments, projects etc.
  2. Compute the weighted final score using the following formula:

        finalScore = 0.35 x Avg AssignmentScore + 0.3 x Avg ExamScore + 0.35 x AvgProjectScore 

  1. Make a dictionary where the key is the student's name and the value is the final weighted score rounded to 3 decimal places.
  2. Return the dictionary

 

 

Task 2:

 

  1. Define the main function
  2. Make a list of dictionaries based on the format given in Task 1 with values of your choice. Alternatively, you can use the sample inputs as well. (Do not use input function to get arguments as it interrupts the autograding scripts)
  3. Call the gradeBook function with the list created
  4. Print the output from the function call
  5. Call the main function using " __name__  == __main__" call as done in the previous assignments

 

 

Sample Input/Output:

 

>> stuList = [{"name": "Sam", "assignments": [90.0, 50.0, 75.0, 60.0], "projects": [35.0, 80.0, 72.0],"exams": [42.0, 56.5]}, {"name":"Anna", "assignments": [100.0, 90, 92, 88.0], "projects": [85.0, 75.0, 88.0],"exams": [95.0, 75.0]},{"name": "Maria", "assignments": [60.0, 70, 80.0, 90.0], "projects": [40.0, 80.0, 95.0], "exams": [80, 70]}]

 

>> gradeBook(stuList)

 

>> {'Sam': 60.654, 'Anna': 86.808, 'Maria': 73.833}
 

finalScore = 0.35 x Avg AssignmentScore +0.3 x AvgExamScore + 0.35 x Avg ProjectScore

Step by Step Solution

There are 3 Steps involved in it

Step: 1

Implementation of the gradeBook function and a main function that follows the provided instructions ... 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

Recommended Textbook for

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Programming questions

Question

Is there statistical significance? What was the effect size?

Answered: 1 week ago

Question

What are the common problems in writing an abstract?

Answered: 1 week ago

Question

Create a Fishbone diagram with the problem being coal "mine safety

Answered: 1 week ago