Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

8 . 1 2 LAB: Grade Summary Write a program that reads student grade information from a text file. Each row of the file contains

8.12 LAB: Grade Summary
Write a program that reads student grade information from a text file. Each row of the file contains the student's Last Name, First Name,
and then some numbers representing exam scores for that student, all separated by tab characters. A sample of the student information is
provided in StudentInfo.tsv. Assume the grade information will have at least one student and one exam and that each student listed will
have the same number of exam grades. Assume also the first and last names contain no whitespace. Your program then creates an output
text file that reports the exam grades and letter grade for each student and then reports the average score for each exam.
The program performs the following tasks:
Prompts the user for the grade information file name.
Open that 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: F:x6060=
F:x60
Compute the average score for 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.
Send a blank line to the output file after the last student line.
On one line, send to the output file one line with the average of each exam, with two digits after the decimal point. Label the exams
"exam 1", "exam 2", etc. Use the text string interpolation with the 8 codes that we discussed in lecture 3.
No imported modules should be used.
Ex: If the input of the program is:
StudentInfo.tsv
and the contents of StudentInfo.tsv are:
the file report.txt should contain:70=
D: 60=
F:x60
Compute the average score for 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.
Send a blank line to the output file after the last student line.
On one line, send to the output file one line with the average of each exam, with two digits after the decimal point. Label the exams
"exam 1", "exam 2", etc. Use the text string interpolation with the 8 codes that we discussed in lecture 3.
No imported modules should be used.
Ex: If the input of the program is:
StudentInfo.tsv
and the contents of StudentInfo.tsv are:
the file report.txt should contain:80=
C: 70=
D: 60=
F:x60
Compute the average score for 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.
Send a blank line to the output file after the last student line.
On one line, send to the output file one line with the average of each exam, with two digits after the decimal point. Label the exams
"exam 1", "exam 2", etc. Use the text string interpolation with the 8 codes that we discussed in lecture 3.
No imported modules should be used.
Ex: If the input of the program is:
StudentInfo.tsv
and the contents of StudentInfo.tsv are:
the file report.txt should contain:90=
B: 80=
C: 70=
D: 60=
F:x60
Compute the average score for 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.
Send a blank line to the output file after the last student line.
On one line, send to the output file one line with the average of each exam, with two digits after the decimal point. Label the exams
"exam 1", "exam 2", etc. Use the text string interpolation with the 8 codes that we discussed in lecture 3.
No imported modules should be used.
Ex: If the input of the program is:
StudentInfo.tsv
and the contents of StudentInfo.tsv are:
the file report.txt should contain:
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What is Centrifugation?

Answered: 1 week ago

Question

To find integral of ?a 2 - x 2

Answered: 1 week ago

Question

To find integral of e 3x sin4x

Answered: 1 week ago

Question

To find the integral of 3x/(x - 1)(x - 2)(x - 3)

Answered: 1 week ago

Question

What are Fatty acids?

Answered: 1 week ago

Question

1. Are my sources credible?

Answered: 1 week ago

Question

3. Are my sources accurate?

Answered: 1 week ago

Question

1. Is it a topic you are interested in and know something about?

Answered: 1 week ago