Question

In: Computer Science

This is an assignment for python. Download the code “ GradeBook.py ” You will be modifying...

This is an assignment for python.

Download the code “

GradeBook.py

You will be modifying the code to do the following:

1)

create an empty dictionary named “FinalAverages”

2) In one for loop you will zip all lists together and get their individual members on each iteration. You can name

these what ever you want.

3) on each iteration: Calculate the WEIGHTED average using the weights provided, and then add a new dictionary

value to the dictionary “

FinalAverages

”. The KEY for this dictionary will be the name on this iteration, and the

VALUE will be the average of the student.

4)

Print

the whole

dictionary,

and

then

print

ONLY ”Jack”

5) BONUS: if you create a function that takes an input of the 4 lists, and an output of the appropriate dictionary:

adding 1 point. Your code must then use this function to create the appropriate dictionary, apply the weights

(Store them in that function), and then output the

values you got.

Gradebook.py is:

Students = ['Bill', 'Sue', 'Janet', 'Cindy', 'Ray', 'Jack', 'Barbra', 'Matt', 'Joey', 'Adam', 'Becky', 'Mona']
Exam1 = [100, 80, 26, 45, 89, 65, 92, 75, 76, 15, 80, 50]
Exam2 = [88, 95, 55, 60, 81, 25, 70, 100, 95, 70, 72, 10]
Exam3 = [65, 92, 100, 80, 26, 92, 55, 60, 80, 55, 60, 75]
scaleExamOne = 0.3
scaleExamTwo = 0.3
scaleExamThree = 0.4

Solutions

Expert Solution

Python code:
def waverage(students,exam1,exam2,exam3,scaleExamOne,scaleExamTwo,scaleExamThree):
result = {}
for i in range(len(students)):
wavg = (exam1[i]*0.3) + (exam2[i]*0.3) + (exam3[i]*0.4)
result[students[i]] = wavg
print(result)
print("Jack Details:")
print(result['Jack'])
  
Students = ['Bill', 'Sue', 'Janet', 'Cindy', 'Ray', 'Jack', 'Barbra', 'Matt', 'Joey', 'Adam', 'Becky', 'Mona']
Exam1 = [100, 80, 26, 45, 89, 65, 92, 75, 76, 15, 80, 50]
Exam2 = [88, 95, 55, 60, 81, 25, 70, 100, 95, 70, 72, 10]
Exam3 = [65, 92, 100, 80, 26, 92, 55, 60, 80, 55, 60, 75]
scaleExamOne = 0.3
scaleExamTwo = 0.3
scaleExamThree = 0.4
waverage(Students,Exam1,Exam2,Exam3,scaleExamOne,scaleExamTwo,scaleExamThree)
Execution screenshots:


Related Solutions

Python code Assignment Overview In this assignment you will practice with conditionals and loops (for). This...
Python code Assignment Overview In this assignment you will practice with conditionals and loops (for). This assignment will give you experience on the use of the while loop and the for loop. You will use both selection (if) and repetition (while, for) in this assignment. Write a program that calculates the balance of a savings account at the end of a period of time. It should ask the user for the annual interest rate, the starting balance, and the number...
In this assignment you will start with Python code that builds a 2 host network connected...
In this assignment you will start with Python code that builds a 2 host network connected by a legacy router. You will modify it such that the two hosts can send packets to each other. It requires that you understand subnet addressing and the function of a router. The network built using Miniedit on a Mininet virtual machine: python mininet/examples/miniedit.py. We need to also make 6 static routes to make the program work. This is the work that I have...
For Python: In this assignment you are asked to write a Python program to determine the...
For Python: In this assignment you are asked to write a Python program to determine the Academic Standing of a studentbased on their CGPA. The program should do the following: Prompt the user to enter his name. Prompt the user to enter his major. Prompt the user to enter grades for 3 subjects (A, B, C, D, F). Calculate the CGPA of the student. To calculate CGPA use the formula: CGPA = (quality points * credit hours) / credit hours...
Create a project for this assignment. You can name it assignment02 if you wish. Download the...
Create a project for this assignment. You can name it assignment02 if you wish. Download the database file pizza-190807A.sqlite into the top level of the project. Create the pizza_services.py module first and put in the code given in the assignment. Using this code ensures that you can use the services in a similar way to the example. The assignment suggests adding a method customer to the class. This will return a list of rows from the customer table in the...
In python make a simple code. You are writing a code for a program that converts...
In python make a simple code. You are writing a code for a program that converts Celsius and Fahrenheit degrees together. The program should first ask the user in which unit they are entering the temperature degree (c or C for Celcius, and f or F for Fahrenheit). Then it should ask for the temperature and call the proper function to do the conversion and display the result in another unit. It should display the result with a proper message....
Homeschooling Proposal IRB In this assignment, you will be provided a proposal. Click here to download...
Homeschooling Proposal IRB In this assignment, you will be provided a proposal. Click here to download the proposal. https://www.homeworkmarket.com/files/proposal.doc Read the proposal, and then, acting as a member of a college IRB asked to approve this study, identify any ethical concerns you have. Write your concerns in a report in a 1- to 2-page Microsoft Word document and make at least three suggestions to reduce the possibility of risk and harm to the participants.
In this programming assignment, you will implement a SimpleWebGet program for non- interactive download of files...
In this programming assignment, you will implement a SimpleWebGet program for non- interactive download of files from the Internet. This program is very similar to wget utility in Unix/Linux environment.The synopsis of SimpleWebGet is: java SimpleWebGet URL. The URL could be either a valid link on the Internet, e.g., www.asu.edu/index.html, or gaia.cs.umass.edu/wireshark-labs/alice.txt or an invalid link, e.g., www.asu.edu/inde.html. ww.asu.edu/inde.html. The output of SimpleWebGet for valid links should be the same as wget utility in Linux, except the progress line highlighted...
Assignment Content Resource: ****************************CODE PASTED BELOW******************************* For this assignment, you will develop Java™ code that relies...
Assignment Content Resource: ****************************CODE PASTED BELOW******************************* For this assignment, you will develop Java™ code that relies on localization to format currencies and dates. In NetBeans, copy the linked code to a file named "Startercode.java". Read through the code carefully and replace all occurrences of "___?___" with Java™ code. Note: Refer to "Working with Dates and Times" in Ch. 5, "Dates, Strings, and Localization," in OCP: Oracle® Certified Professional Java® SE 8 Programmer II Study Guide for help. Run and debug...
Week 1 Assignment Complete this two page assignment by the end of week 1! Download and...
Week 1 Assignment Complete this two page assignment by the end of week 1! Download and open the Word document below....fill in the blank and highlight the answer to the questions or fill in the blank. Resubmit here when you're finished by adding your completed assignment as a file! BIO 212 Assignment 1.docx BIO 212 Assignment 1 Fill in the Blank: Use the table on pg. 848-853 in your textbook to help you fill in the blank. Drug Classification Action...
Python Explain Code #Python program class TreeNode:
Python Explain Code   #Python program class TreeNode:    def __init__(self, key):        self.key = key        self.left = None        self.right = Nonedef findMaxDifference(root, diff=float('-inf')):    if root is None:        return float('inf'), diff    leftVal, diff = findMaxDifference(root.left, diff)    rightVal, diff = findMaxDifference(root.right, diff)    currentDiff = root.key - min(leftVal, rightVal)    diff = max(diff, currentDiff)     return min(min(leftVal, rightVal), root.key), diff root = TreeNode(6)root.left = TreeNode(3)root.right = TreeNode(8)root.right.left = TreeNode(2)root.right.right = TreeNode(4)root.right.left.left = TreeNode(1)root.right.left.right = TreeNode(7)print(findMaxDifference(root)[1])
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT