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...
can you please convert this python code into java? Python code is as shown below: #...
can you please convert this python code into java? Python code is as shown below: # recursive function def row_puzzle_rec(row, pos, visited):    # if the element at the current position is 0 we have reached our goal    if row[pos] == 0:        possible = True    else:        # make a copy of the visited array        visited = visited[:]        # if the element at the current position has been already visited then...
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...
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...
In this program, you are modifying given code so that the class is object-oriented. 2. Write...
In this program, you are modifying given code so that the class is object-oriented. 2. Write a Java class called CityDistancesOO in a class file called CityDistancesOO.java.    3. Your class will still make use of two text files. a. The first text file contains the names of cities with the first line of the file specifying how many city names are contained within the file.    b. The second text file contains the distances between the cities in the...
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...
Module 2 Programming Assignment – Battleship Refactor Refactor your Battleship drawing code from Module 1. Download...
Module 2 Programming Assignment – Battleship Refactor Refactor your Battleship drawing code from Module 1. Download the OO template for the basic battleship game, BattleshipRefactor.zip (refer below) The template has the outline of a battleship game using OO constructs. You need to add the Grid class and complete the code so that it runs correctly. At a minimum, you need to complete the Draw and DropBomb methods with code similar to the previous assignment. There will be changes due to...
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....
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT