Write a Python program that chooses the best 5 quiz scores from a file with student ID and scores. Your program must have 2 functions; the main and removeMin. 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 6 values representing the scores attained by the Student in 6 quizzes. For each Student, the removeMin function receives a list containing the 6 values and returns another list containing the best 5 quiz scores performed by that Student. This information will be written in an output file as shown below. 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 6 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 14.2 17.4 13.8 34 56 201210345 14.2 13.7 11.8 12.3 34 201910532 11.8 16.4 15.9 23 67 201810723 18.3 14.8 17.3 16.2 37.3 201610285 16.3 14.2 13.8 55 83.8 201210288 15.2 13.5 14.7 44.4 94.4

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

python 3

Write a Python program that chooses the best 5 quiz scores from a file with student ID and scores. Your
program must have 2 functions; the main and removeMin.
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 6 values representing the scores attained by the Student in 6
quizzes.
For each Student, the removeMin function receives a list containing the 6 values and returns another list
containing the best 5 quiz scores performed by that Student. This information will be written in an
output file as shown below.
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 6 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 14.2 17.4 13.8 34 56
201210345 14.2 13.7 11.8 12.3 34
201910532 11.8 16.4 15.9 23 67
201810723 18.3 14.8 17.3 16.2 37.3
201610285 16.3 14.2 13.8 55 83.8
201210288 15.2 13.5 14.7 44.4 94.4
Transcribed Image Text:Write a Python program that chooses the best 5 quiz scores from a file with student ID and scores. Your program must have 2 functions; the main and removeMin. 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 6 values representing the scores attained by the Student in 6 quizzes. For each Student, the removeMin function receives a list containing the 6 values and returns another list containing the best 5 quiz scores performed by that Student. This information will be written in an output file as shown below. 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 6 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 14.2 17.4 13.8 34 56 201210345 14.2 13.7 11.8 12.3 34 201910532 11.8 16.4 15.9 23 67 201810723 18.3 14.8 17.3 16.2 37.3 201610285 16.3 14.2 13.8 55 83.8 201210288 15.2 13.5 14.7 44.4 94.4
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 3 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.
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