subject

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, Midterm 1 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 FX<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. Ex If the input of the program is: Student Info. tav . and the contents of Studentinfo. ts are: Barrett Edan 70 45 59 Bradshaw Reagan 96 97 88 Charlton Calus 73 94 80 Mayo Tyrene 88 51 Sun Brenda 90 86 45 the file report txt should contain Darrett dan 70 Bradsha Rengan 96 Charlton 93 Mayo Tyre se BB 6 Brenda 90 45 59 02 GB 94 30 36 D 23 etv SR Lr main. py Load default template with open('Student Info. tsv","") as if : #file open with open('report. txt", "W") as wf: #we write to new file report. txt Pilel - open('reprt. txt', 'a') for line in c: line - line. strip) 1st - line. split("\t") sum - int (1at121)+int (1st (31)+int (st (411 average - bum/3 if average 90 gradom 'A' 1 elit average - BO: gradewa elif average > 701 gradec elit average > 601 grade else grade - wr. write(linet grade.\n").writen into wr written the new File Titel weite("Avaragent side ). 40, medtem 76.60, final 61.60) nou Studenti foto Barrett Sead 70 55 Your le con Cars Mayo stem Tyres 23 53 10 45 59 Expected content Charlton Mayo 61 36 sistem... 16.00, tinal. Outes Shirts below 013 Tout stolta 45 24 $ 80 888 $ A % 5 * 6 & 7 8 9 0 W R. T Y e st U 0 a F To Brenda 10 Bartlepe37-5555 hartt dan Baba Heagan 855 Cabott 85 Charlton rynna 9510 2 Moldes*7146 Rigonya-5-5-5600 Hayo Tyres 576 Mir Johnny66 Precauty Hobitonelynda 496-30-550 Stern Brenda 650 Statytomelo 51-531 Expected file content Come output Output offers so highlights below the © Bert an Badan Your le content 89 0.00 Previous submissions 23 V LE $ Il $ 4 % 5 & 4 6 7 00 * 9 0 R T 0 Р

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 02:30
If you turn on the lock alpha button , what happens
Answers: 1
question
Computers and Technology, 22.06.2019 15:30
What is a costume plot? why is it important to a film or theater production?
Answers: 2
question
Computers and Technology, 23.06.2019 07:30
What key should you press and hold to select and open multiple files at one time? enter alt control esc
Answers: 1
question
Computers and Technology, 23.06.2019 15:00
1. which of the following statements are true about routers and routing on the internet. choose two answers. a. protocols ensure that a single path between two computers is established before sending packets over it. b. routers are hierarchical and the "root" router is responsible for communicating to sub-routers the best paths for them to route internet traffic. c. a packet traveling between two computers on the internet may be rerouted many times along the way or even lost or "dropped". d. routers act independently and route packets as they see fit.
Answers: 2
You know the right answer?
Write a program that reads the student information from a tab separated values (tsv) file. The progr...
Questions
question
Social Studies, 30.01.2020 07:47
question
Mathematics, 30.01.2020 07:47