. . . // If the input file does not exist, this will detect that. // We handle that by printing an error message and stopping the program. if ( In.fail() ) { cout << "Data file not found: " // Write an error message... << dataFileName // including the file name. << endl // Bang "return" << "Exiting now..." << endl; // Finish the message. return 1; // Traditional to return 1 on failure. } . . . // Now calculate the average score. double AverageScore; if ( NumberOfPlayers > 0 ) { // Check to be sure it's safe to divide. // We convert the integers to decimal values before dividing: AverageScore = double(SumOfScores) / double(NumberOfPlayers); } else { AverageScore = 0.0; }