Here is my code and it takes in a .txt file and separates the number by greater or less than 70. I need to get an average of those numbers as well. I don't know what I am dong wrong. Any help would be appreciated. I am getting like double the average I am supposed to get.
Thanks for help from anyone.
// Opens the file specified by Filename. If the connection fails it
// returns false, else it returns true.
bool Connect2Input(string Filename, ifstream& fin);
// Displays the two counts along with their averages, one per line.
void DisplayCounts(int CountOver70, int CountBelow70,
int AveOver70, int AveBelow70);
int main()
{
int AveBelow70=0;
int AveOver70=0;
int CountOver70=0;
int CountBelow70=0;
int sum=0;
ifstream fin;