Write a Python program that calculates the average 5 quiz scores fr Your program must have 2 functions; the main and calculateAvg. The main function reads data from an input file, which has the form starts with the Student ID followed by 5 values representing the sco quizzes. For each Student, the calculateAvg function receives a list containir ist containing all the values in the original list plus the average scor This information will be written in an output file as shown below. Also, you must include the class average at the end. Which includes Note: You program must be general and works for any number of Studen

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Write a Python program that calculates the average 5 quiz scores from a file with student ID and scores.
Your program must have 2 functions; the main and calculateAvg-
The main function reads data from an input file, which has the format shown below. Each line in the file
starts with the Student ID followed by 5 values representing the scores attained by the Student in 5
quizzes.
For each Student, the calculateAvg function receives a list containing the 5 values and returns another
list containing all the values in the original list plus the average score of the quizzes for each student.
This information will be written in an output file as shown below.
Also, you must include the class average at the end. Which includes all the students in the list.
Note:
You program must be general and works for any number of Students.
All reading and writing must be done in the main function.
Assume each student has 5 quiz scores
Input text file name must be grades.txt
Output text file name must be gradesmin.txt
Please include the file names in the program and no need to ask the user for file names.
Sample input file below: (you can copy/paste and save below data as text file for input)
201310232 12.4 14.2 17.4 13.8 34 56
201210345 14.2 13.7 11.8 12.3 34 11
201910532 11.8 16.4 10.2 15.9 23 67
201810723 18.3 14.8 17.3 16.2 2.3 37.3
201610285 12.8 16.3 14.2 13.8 55 83.8
201210288 13.5 15.2 13.5 14.7 44.4 94.4
Sample output file below:
201310232 12.4 14.2 17.4 13.8 34 56 15.12
201210345 14.2 13.7 11.8 12.3 34 11 7.87
201910532 11.8 16.4 10.2 15.9 23 67 14.62
201810723 18.3 14.8 17.3 16.2 2.3 37.3 9.16
201610285 12.8 16.3 14.2 13.8 55 83.8 21.99
201210288 13.5 15.2 13.5 14.7 44.4 94.4 21.96
The class average is: 58.25
Transcribed Image Text:Write a Python program that calculates the average 5 quiz scores from a file with student ID and scores. Your program must have 2 functions; the main and calculateAvg- The main function reads data from an input file, which has the format shown below. Each line in the file starts with the Student ID followed by 5 values representing the scores attained by the Student in 5 quizzes. For each Student, the calculateAvg function receives a list containing the 5 values and returns another list containing all the values in the original list plus the average score of the quizzes for each student. This information will be written in an output file as shown below. Also, you must include the class average at the end. Which includes all the students in the list. Note: You program must be general and works for any number of Students. All reading and writing must be done in the main function. Assume each student has 5 quiz scores Input text file name must be grades.txt Output text file name must be gradesmin.txt Please include the file names in the program and no need to ask the user for file names. Sample input file below: (you can copy/paste and save below data as text file for input) 201310232 12.4 14.2 17.4 13.8 34 56 201210345 14.2 13.7 11.8 12.3 34 11 201910532 11.8 16.4 10.2 15.9 23 67 201810723 18.3 14.8 17.3 16.2 2.3 37.3 201610285 12.8 16.3 14.2 13.8 55 83.8 201210288 13.5 15.2 13.5 14.7 44.4 94.4 Sample output file below: 201310232 12.4 14.2 17.4 13.8 34 56 15.12 201210345 14.2 13.7 11.8 12.3 34 11 7.87 201910532 11.8 16.4 10.2 15.9 23 67 14.62 201810723 18.3 14.8 17.3 16.2 2.3 37.3 9.16 201610285 12.8 16.3 14.2 13.8 55 83.8 21.99 201210288 13.5 15.2 13.5 14.7 44.4 94.4 21.96 The class average is: 58.25
Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Lists
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education