Write a Python program that reads from each line of an input file called grades.txt, a student id followed by the student grades in 3 exams. The program will then calculate the average of the student and save in a file called results.txt the student id followed by the calculated average. For example, if the grades.txt contains si11 60 60 90 S222 89.5 90 89 S333 42 50 43 The file results.txt will contain si11: 70.00 S222: 89.50 S333: 45.00

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter13: File Input And Output
Section: Chapter Questions
Problem 6PE
icon
Related questions
Question
Solve it in different way
Write a Python program that reads from each line of an input file called grades.txt, a student id followed
by the student grades in 3 exams. The program will then calculate the average of the student and save in
a file called results.txt the student id followed by the calculated average. For example, if the grades.txt
contains
sii1 60 60 90
S222 89.5 90 89
S333 42 50 43
The file results.txt will contain
si11: 70.00
S222: 89.50
S333: 45.00
Transcribed Image Text:Write a Python program that reads from each line of an input file called grades.txt, a student id followed by the student grades in 3 exams. The program will then calculate the average of the student and save in a file called results.txt the student id followed by the calculated average. For example, if the grades.txt contains sii1 60 60 90 S222 89.5 90 89 S333 42 50 43 The file results.txt will contain si11: 70.00 S222: 89.50 S333: 45.00
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Constants and Variables
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
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT