On a given exam, the points awarded for each problem are recorded in a text file, with one line of the file for each student that took the exam. Create a program that reads this text file and determines

  • each student’s total grade for the exam
  • the class average for the exam
  • the average number of points given for each problem

Program Requirements

  • The input data file will be a plain text file with each number separated by a single space.
  • All numerical data (student ID, scores) must be stored in a 2-dimensional array.
    • The final column of the array should hold the total score for each student. Caution: do not include the student ID in the sums!
    • The final should hold the averages for each column.
    • There will be 4 problems and 5 students, so the array should hold 6 rows (5 students + average) and 6 columns (ID, 4 grades, and exam total).
  • All calculations and array access must be performed using pointers and dereferencing. You may use [ ] only when reading and writing the data files.
  • The results must be printed to the screen as well as written to a file in table format.

Program Organization

Your program should contain the following functions: main, loadDataFile, calculateResults, writeResultsFile, and printResults.

  • main – create empty 6x6 2-D array to hold data and then call other functions as needed, passing them the array
  • loadDataFile – read the input file, storing the data in the 2-D array
  • calculateResults – performs all calculations
  • writeResultsFile – creates and writes the resulting array to the output data file
  • printResults – prints the results to the screen

Example Input: See image.

Example Output: See image.

Academic Honesty!
It is not our intention to break the school's academic policy. Projects posted are only 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 fill out the form. Please provide a valid email address and we'll get back to you in less than 24 hours. We will be sending an invoice through PayPal upon confirmation. We are a non profit organization however we need an amount to keep this organization running, and to be able to complete our research and development.