My program is supposed to read input ( a student ID and then a score, separated by a space) from a user named file, store that data in a struct, and compute the average of all the scores. If the student's score is 10 points above or below the average, then the string Satisfactory is supposed to store in gradeString. If the score is more than 10 points above the average, then the string outstanding should be stored in gradeString, and if the students' score is more than 10 points below average then unsatisfactory should be stored in gradeString. Then another function prints out the ID, the score, and the gradeString. My problem is that the score does not seem to be read properly. When I run the program, the score shows up for every student as -10 and the gradeString that is printed is Satisfactory. First of all, I cannot figure out what I am doing wrong as far as reading in the score. Isn't the white space between the ID and score skipped and the next input read from the next character?

I checked the average by doing cout in that function, and that looks like it is calculated correctly. So I am not sure why every gradeString is not stored as unsatisfactory since all the scores are -10 which is definitely lower than 'more than 10 points below the average'.

Here is my code. If you could help me figure out where I went wrong, I would greatly appreciate it.
Code:
 /* The format of the input data file is multiple lines, each containing an ID number followed by a score:

    12345 90
    23456 100
    31245 66
    ......
    */

    /* The program structure is as follows:

    main
      openInputFile
      populateArrayOfStructures
         computeAverage
         populateGradeField
      printTable

    */

    #include <iostream>
    #include <string>
    #include <fstream>
    #include <iomanip>

    using namespace std;


    struct StudentData
    {
      int id;
      int score;
      string gradeString;
    };


    const int MAX_SIZE = 21; // size of array
    const bool DEBUG = true; // used during testing
    //const bool DEBUG = false; // used during production

    void populateArrayOfStructures (ifstream& ins, StudentData data[], int& count, bool& tooMany);
    float computeAverage (StudentData data[], int count);
    void printTable (StudentData data[], int count);
    void populateGradeField (StudentData data[], int count, float average);
    void openInputFile (ifstream& ins);

    void main()
    {
      ifstream ins;
      StudentData data[MAX_SIZE];
      int count;
      bool tooMany;

      openInputFile(ins);
      populateArrayOfStructures (ins, data, count,tooMany);
      if (count <= 0)
      {
      	cout << "No items read from file" << endl;
      	cout << "Exiting program." << endl;
      	exit(0);
      }
      if (DEBUG)
      {
    	cout << "Items read from file:" << count << endl;
    	cout << "Value of tooMany: " << tooMany << endl;
      }
      if (tooMany)
      {
    	cout <<"There are more than " << MAX_SIZE << " items in file." << endl;
      }
      if (DEBUG) cout << "Processing " << count << " items from the input file." << endl;

      printTable (data, count);
    }



    /*
       This function uses a loop to populate the id and score fields of the array. It then calls computeAverage to get the
       average score and then calls populateGradeField to populate the gradeString fields in the array.

       The function also calculates and places values in the count and tooMany OUT parameters.
    */
    void populateArrayOfStructures (ifstream& ins, StudentData data[], int& count, bool& tooMany)
    {
		float average = 0;
		count = 0;
		
	for (int i = 0; i < MAX_SIZE; i++)
	{
		ins >> data[i].id >> data[i].score;
		count++;
	}
	if (DEBUG)
      {
    	cout << "count:" << count << endl;
     }
		computeAverage(data, count);
		populateGradeField(data, count, average);
	if (count > MAX_SIZE)
	{
		tooMany = true;
	}


    }



    /*
        This function simply displays the data in the array of structures on the screen.
    */
    void printTable (StudentData data [], int count)
    {
		for (int i = 0; i < MAX_SIZE; i++)
		{
			cout << data[i].id << ' ' << data[i].score << ' ' << data[i].gradeString << '\n';
		}

	

    }


    /*
        This function compares the average with each score in the array and populates the gradeString fields in the array.
    */
    void populateGradeField (StudentData data[], int count, float average)
    {

		for (int i = 0; i < MAX_SIZE; i++)
		{
			if ((data[i].score = (int(average) - 10)) || (data[i].score = (int(average)+ 10)))
			{
				data[i].gradeString = "Satisfactory";
			}
			if ((data[i].score > (int(average) + 10)))
			{
				data[i].gradeString = "Oustanding";
			}
			if ((data[i].score < (int(average) - 10)))
			{
				data[i].gradeString = "Unsatisfactory";
			}
			
		} 

	

    }


    /*
        Based on the scores in the array, this function calculates and returns the average
    */
    float computeAverage (StudentData data[], int count)
    {
	int sum = 0;
	float average = 0;

	for (int i = 0; i < MAX_SIZE; i++)
		{
			sum += data[i].score;
		}
		average = float(sum) / float (count);
	if (DEBUG)
      {
    	cout << "average:" << average << endl;
     }	

			
      	return average;
    }


    /*
       This function prompts the user for the input file name and then attempts to open that file. If the
       file cannot be opened the function displays a message and terminates the program.
    */
    void openInputFile (ifstream& ins)
    {
	string fileName;

  	cout << "Enter name of the first input file" << endl;
 	cin >> fileName;

  	ins.open (fileName.c_str());
  	if (ins.fail())
  		{
			cout << "Could not open file " << fileName << endl;
			cout << "Exiting program." << endl;
			exit (0);
  		}

    }