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...
Download Jupyter and complete your Assignment. Be sure to write and run the code separately for...
Download Jupyter and complete your Assignment. Be sure to write and run the code separately for each part. Please provide explanation for the code logic behind the code you write / design. First part: Create Simple Student Class with constructor to get first name and last name. Second part: Then create Address class with the constructor to get Student Address, the parameters can be , House/Apt Number, Street, Zip, State. Third part: Modify Student Class so that it will get...
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...
Write the code in python only. You will need the graphics library for this assignment. Please...
Write the code in python only. You will need the graphics library for this assignment. Please download the library and place it in the same file as your solution. Draw a 12" ruler on the screen. A ruler is basically a rectangular outline with tick marks extending from the top edge. The tick marks should be drawn at each quarter-inch mark. Below the tick marks, your ruler should show large integers at each full-inch position.
PLEASE DONT FORGET TO SOLVE THE ASSIGNMENT QUESTION MOST IMP: Ex1) Download the code from the...
PLEASE DONT FORGET TO SOLVE THE ASSIGNMENT QUESTION MOST IMP: Ex1) Download the code from the theory section, you will find zipped file contains the code of Singly linked list and Doubly linked list, in addition to a class Student. In Class SignlyLinkedList, 1. There is a method display, what does this method do? 2. In class Test, and in main method, create a singly linked list objet, test the methods of the list. 3. To class Singly linked list,...
Use Python to solve: show all code: 2) For the last assignment you had to write...
Use Python to solve: show all code: 2) For the last assignment you had to write a program that calculated and displayed the end of year balances in a savings account if $1,000 is put in the account at 6% interest for five years. The program output looked like this: Balance after year 1 is $ 1060.0 Balance after year 2 is $ 1123.6 Balance after year 3 is $ 1191.02 Balance after year 4 is $ 1262.48 Balance after...
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 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...
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...
Ex1) Download the code from the theory section, you will find zipped file contains the code...
Ex1) Download the code from the theory section, you will find zipped file contains the code of Singly linked list and Doubly linked list, in addition to a class Student. In Class SignlyLinkedList, 1. There is a method display, what does this method do? 2. In class Test, and in main method, create a singly linked list objet, test the methods of the list. 3. To class Singly linked list, add the following methods: a- Method get(int n), it returns...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT