Not getting the expected output
<p>I am writing a homework assignment that asks for the user to read in a text file that contains an unknown number of SSNs and grades. The program then needs to compute the max, min and average scores, then output the max grade with the associated SSN as well as the min and avg grades.</p>

<p>It seems to operate correctly but the output is all "0".</p>

<p>Any help fixing this is greatly appreciated.</p>

<p>Code:</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;fstream&gt;
#include &lt;string&gt;
#include &lt;iomanip&gt;


using namespace std;

int main()
{
    string ssn, maxSSN;
    int grade = 0, totalGrades = 0, count = 0, maxScore = 0, minScore = 0;
    double avgScore = 0;

    ifstream inFile;
    inFile.open("C:\\lab5a.txt");

    if(!inFile)
    {
        cout &lt;&lt; "Error opening the requested file\n\n";
        system("pause");
        return 101;
    }



    while (!inFile.eof())
    {
        if (count == 0)
        {
            maxScore = grade;
            minScore = grade;
        }
        else
        {
            if (grade &gt; maxScore)
                maxScore = grade;
            if (grade &lt; minScore)
                minScore = grade;
        }
            grade += totalGrades;
            count++;

    }

    if (count)
        avgScore = totalGrades / count;

    cout &lt;&lt; "Maximum Score: " &lt;&lt; maxScore &lt;&lt; "      Student SSN:" &lt;&lt; maxSSN &lt;&lt; "\n";
    cout &lt;&lt; "Minimum Score: " &lt;&lt; minScore &lt;&lt; "\n";
    cout &lt;&lt; "Average Score: " &lt;&lt; avgScore &lt;&lt; "\n";
    // studentFile &gt;&gt; ssn &gt;&gt; grade;

    inFile.close();

    cout &lt;&lt; "\n\n";
    system("pause");
    return 0;

}
</code></pre>
