Name: ____________________________________________________ Alpha: _____________________

Describe help received: _________________________________________________________________

  1. [100pts] Write a program that reads in a file like grades.txt containing n homework grades for m students (each row consists of the n grades for one student) and prints out the scores along with the averages in decreasing order of average. Note that the file states how many students and how many grades per student. A run of your program should look like:
    ~/$ ./hw
    File name: grades.txt
    81 91 86 82 81 91 92 91 81 98 ave = 87.4
    88 81 94 59 95 65 98 88 93 82 ave = 84.3
    96 67 56 74 94 99 98 68 95 65 ave = 81.2
    96 84 68 54 98 80 55 73 96 96 ave = 80
    76 97 88 69 64 94 54 75 83 65 ave = 76.5
    96 66 58 71 87 59 81 78 69 77 ave = 74.2
    58 96 65 72 93 67 59 74 95 56 ave = 73.5
    76 85 77 95 87 72 64 62 55 51 ave = 72.4
    97 65 63 89 69 84 51 78 68 55 ave = 71.9
    79 52 80 67 56 80 75 63 52 57 ave = 66.1
    Turn In a printout of your source code along with a screen capture showing the output of your program.