Computers and Technology

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 Р

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 11:30, neekWYB
Andrina writes letters that are regularly sent to hundreds of her company’s customers. because of this, she would like for the mail merge command to be in her quick access toolbar, and she wants it to be the first button on the left. what should andrina do to place the mail merge button there?
Answers: 1
image
Computers and Technology, 22.06.2019 17:00, DRock4976
Which of the following is not contained on the slide show toolbar? a. next button b. slide button c. close button d. pen too
Answers: 2
image
Computers and Technology, 23.06.2019 20:40, aurikmah2005
Instruction active describing list features which statements accurately describe the features of word that are used to create lists? check all that apply. the tab key can be used to create a sublist. the enter key can be used to add an item to a list. the numbering feature allows for the use of letters in a list. the numbering feature can change the numbers to bullets in a list. the multilevel list feature provides options for different levels in a list.
Answers: 2
image
Computers and Technology, 24.06.2019 09:40, anyar
Healthy study habits are best described as
Answers: 1
Do you know the correct answer?
Write a program that reads the student information from a tab separated values (tsv) file. The progr...

Questions in other subjects:

Konu
Mathematics, 15.04.2020 22:22
Konu
Geography, 15.04.2020 22:22