- 1of 1 vote
Average Marks of Lowest ID Student:- hkadam36 May 27, 2021 in United States
In this problem, you have to write a program that reads a file containing scores received by students in a number of
subjects, and does some processing on it.
The input is being read in from a file called input.txt, in this format:
22, Data Structures, 45
23, English, 52
22, English, 51
26, Data Structures, 72
23, Data Structures, 61
24, English, 81
Each line consists of three fields "Student ID," "Subject," and "Marks." "Student ID" and "Marks" are integers and
"Subject" is a string that does not contain commas or newlines. There can be any number of students and up to 6 subjects.
Your program should read this file, compute the average marks scored across all subjects by the student with the lowest ID, and write the average marks to a file called output.txt.
For example, if your program is run with the input given above, then at the end the file output.txt should contain just
48. That's because 48 is the average of the marks received by the student with ID 22 (which is the lowest ID).
***Need code in python****
| Report Duplicate | Flag | PURGE
Open Chat in New Window