Computer Programming

Question

The attached file data.txt, contains a class data that consists of an id numbers and a test scores for each of the students in a class. We don’t know the number of students in the class and must use 0 as sentinel.

  1. Write a function that reads the data from the file until 0 is encountered for the id number, counts the number of students and finds the average of the test not including 0.  At this point you must close the file.

  2. Write a second function that prints the average calculated in the previous function, opens the same file again, reads the id and score for each of the students in the file using the counter from the previous function. Further this function will call another function that will write to a file, the id number, the score, and a message stating whether the score is below the class average, is equal to the class average or above the class average. 

  3. The source, Input, output files
  4. A flowchart.
  5. Hierarchical chart.


Details
Attachments
Purchase An Answer Below

Have a similar question?