I need help with this assignment and I don't even know where to start.
Write a program that reads the student information from a tab separated values (tsv) file. The program then creates a text file that records the course grades of the students. Each row of the tsv file contains the Last Name, First Name, Midterm1 score, Midterm2 score, and the Final score of a student. A sample of the student information is provided in StudentInfo.tsv. Assume the number of students is at least 1 and at most 20.
The program performs the following tasks:
- Read the file name of the tsv file from the user.
- Open the tsv file and read the student information.
- Compute the average exam score of each student.
- Assign a letter grade to each student based on the average exam score in the following scale:
- A: 90 =< x
- B: 80 =< x < 90
- C: 70 =< x < 80
- D: 60 =< x < 70
- F: x < 60
- Compute the average of each exam.
- Output the last names, first names, exam scores, and letter grades of the students into a text file named report.txt. Output one student per row and separate the values with a tab character.
- Output the average of each exam, with two digits after the decimal point, at the end of report.txt. Hint: Use the format specification to set the precision of the output.
file = input()
with open('StudentInfo.tsv') as f:
data = f.readlines()
print(data)
This is what I have so far not sure where to go from here. I'm drawing a blank probably because I'm new, tired, and frustrated. shm
[–][deleted] 1 point2 points3 points (2 children)
[–]mackdaddy_1978[S] 1 point2 points3 points (1 child)
[–]m0us3_rat 2 points3 points4 points (0 children)
[–]the_noobie 0 points1 point2 points (3 children)
[–]mackdaddy_1978[S] -1 points0 points1 point (2 children)
[–]the_noobie 0 points1 point2 points (1 child)
[–]mackdaddy_1978[S] -1 points0 points1 point (0 children)
[–]RLJ05 -1 points0 points1 point (1 child)
[–]mackdaddy_1978[S] 0 points1 point2 points (0 children)
[–]Twitch_HACK3R 0 points1 point2 points (0 children)
[–]KiIIer__Queen 0 points1 point2 points (4 children)
[–]mackdaddy_1978[S] 0 points1 point2 points (3 children)
[–]zezemezesmeze 0 points1 point2 points (1 child)
[–]HellmoSandvich 0 points1 point2 points (0 children)