categories.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
  1. Copy the main template provided in the breakout room activity onto your IDE
  2. Add the implementation for the sum_grades(all_categories) function which returns the sum of the weighted average of grades for all categories

The following example will show you how we compute the final grade for the course from categories with weights and grades for those categories. This is not what needs to be printed out when the user chooses to Compute the grade. This is simply to demonstrate the math behind the computation.

There are 5 categories in this example:

PA : 5.0%

CA : 15.0%

LA : 25.0%

QUIZ : 25.0%

PROJECT : 25.0%

Provided grades: PA grades [100.0, 100.0, 100.0, 100.0, 100.0, 0.0, 95.0]

CA grades [100.0, 100.0, 98.0, 95.0, 0.0, 100.0]

LA grades [100.0, 100.0, 100.0, 5.0, 0.0, 70.0]

Quiz Grades []

Project Grades []

Sum of grades for PA category: 595.00

Sum of grades for CA category: 493.00

Sum of grades for LA category: 375.00

Sum of grades for Quiz Category: 0.00

Sum of grades for Project category: 0.00

Average grade for PA category: 595.00/7 * 0.05 = 4.25

Average grade for CA category: 493.00/6 * 0.15 = 12.32

Average grade for LA category: 375.00/6 * 0.25 = 15.62

Average grade for Quiz category: 0 * 0.25 = 0.00

Average grade for Project category: 0 * 0.25 = 0.00

Total Average grade = 4.25 + 12.32 + 15.62 + 0.00 + 0.00 = 32.20

Pseudo Code for calculating average grade

set overall avg_sum to 0

for category in all_categories: #go through each category list in all_categories set current category grade sum to 0

if len(category) == 2 # if a category only has a name and weight, but no list of grades,

# then treat it as not having any grades for that category,

# in which case you add 0 to avg_sum and move onto the next category otherwise,

for grade in category[2]:

#go through the grades list as added in 2nd index of category list

add value of grade to category grade sum value

add value of ((sum / length of category[2] list) * percentage defined in category[1]) to avg_sum return the avg_sum

In the main program (the grade management system defined in the breakout room lab), add the following lines to prompt the user for computing grade:

elif opt == …: # add the appropriate option key from the menu to compute grades

avg_grade = sum_grades(…) #implement this function in the main file to compute average grade print(f"Average Grade is: {avg_grade}")

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY