Monday, December 12, 2011

Homework 5 - average scores

Write a program that reads in an unknown number of integer values from a text file and stores them in a vector. Display the unsorted values then sort and sum the values. Display the sorted values, the average value, and total count to the user. Make sure to use an iterator to process the vector.

   string getFilename(string prompt)
   void readValuesFromFile(string filename,
      vector<int> &values)
   void displayValues(string leader,
      vector<int> &values,
      vector<int>::iterator pos)
   int sumValues(vector<int> &values,
      vector<int>::iterator pos)


Sample Output
Here is a screenshot of my code running.

Average Value output

Refer to the deliverables post for comment formatting and required program identification information.

Due Date:
Sunday, December 18th, 6:00pm