Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Step by Step Solution

3.28 Rating (163 Votes )

There are 3 Steps involved in it

Step: 1

def main test1 intinputEnter test grade 1 test2 intinpu... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Analysis And Decision Making

Authors: Christian Albright, Wayne Winston, Christopher Zappe

4th Edition

538476125, 978-0538476126

More Books

Students also viewed these Programming questions

Question

Discuss the mechanism used to read data from or write data to disk.

Answered: 1 week ago

Question

Why cant we just make our home grown?

Answered: 1 week ago

Question

Explain the process of MBO

Answered: 1 week ago

Question

Explain the interconnections between project scope, time, and cost.

Answered: 1 week ago

Question

Calculate the missing value.

Answered: 1 week ago