In Python use a loop to read data from a text file which containing students' names and
Question:
In Python use a loop to read data from a text file which containing students' names and exam scores. The program should calculate the exam average for each student, determine the appropriate letter grade for that exam average, and count the total number of A's, B's, C's, D's, and F's for the whole class. The text file can be accessed using this link: scores.txt .
You need to print each strudent's name and their letter grade based on the averages of their 3 exam scores.
After printing all of the names and grades, you need to print a summary stating the number of As, Bs, Cs, Ds, and Fs for the whole class.
To get the letter grades you'll need to calculate the average of the 3 exam for each student and determine the appropriate letter grade for that average based on the criteria listed above. The code that determines the letter grade needs to be in it's own function.
The loop that reads the file should be able to work properly even if the number of students in the file is unknown or varies from day to day. That is, don't use 30 as a magic number. The program should work no matter how many records the file might contain.
Your program must have at least 2 functions A main() function, and a function to determine the letter grade. You could easily have more than 2 functions
Data Analysis and Decision Making
ISBN: 978-0538476126
4th edition
Authors: Christian Albright, Wayne Winston, Christopher Zappe