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 setprecision manipulator to format the output.

Ex: If the input of the program is:

StudentInfo.tsv

and the contents of StudentInfo.tsv are:

Barrett Edan 70 45 59
Bradshaw Reagan 96 97 88
Charlton Caius 73 94 80
Mayo Tyrese 88 61 36
Stern Brenda 90 86 45
the file report.txt should contain:
Barrett Edan 70 45 59 F
Bradshaw Reagan 96 97 88 A
Charlton Caius 73 94 80 B
Mayo Tyrese 88 61 36 D
Stern Brenda 90 86 45 C

Averages: midterm1 83.40, midterm2 76.60, final 61.60
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.