Write a function "finalGrade" that takes a list "classList" which contains a sublist for each student. Each sublist contains three grades; attendance, exam grade, and homework grade. You need to return a tuple that contains the average of attendance, average of exams, and average of homeworks for the whole class.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter7: Arrays
Section7.5: Case Studies
Problem 3E
icon
Related questions
Question
Programming language is latest version of python
EXERCISES
Exercise 1
Write a function "finalGrade" that takes a list "classList" which contains a sublist for each
student. Each sublist contains three grades; attendance, exam grade, and homework grade. You need to
return a tuple that contains the average of attendance, average of exams, and average of homeworks
for the whole class.
Sample Input
classList
[[20,80,90], (10,60,40], [17, 77,56], [21,99,991]
%3D
Sample Output
(17,79,71.25)
*Hints: The class has 4 students
average attendance = (20+10+17+21)/4 = 17
average exams =
(80+60+77+99)/4
79
%3D
average homeworks = (90+40+56+99)/4 = 71.25
Transcribed Image Text:EXERCISES Exercise 1 Write a function "finalGrade" that takes a list "classList" which contains a sublist for each student. Each sublist contains three grades; attendance, exam grade, and homework grade. You need to return a tuple that contains the average of attendance, average of exams, and average of homeworks for the whole class. Sample Input classList [[20,80,90], (10,60,40], [17, 77,56], [21,99,991] %3D Sample Output (17,79,71.25) *Hints: The class has 4 students average attendance = (20+10+17+21)/4 = 17 average exams = (80+60+77+99)/4 79 %3D average homeworks = (90+40+56+99)/4 = 71.25
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Introduction to computer system
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning