We was asked to create a program using a class called CounterType that counted things. Then we had to create a program using 3 CounterTypes, one for positive Numbers, Negative Numbers, and Zeroes. It reads in data from a text file which we customize the numbers to make sure it works. We have the program near perfect, with one fault. It adds an extra count to whatever the last digit of the text file is. For example if it ends in Negative, it adds an extra count to the negative counter.
You usually want to see if the input extraction is successful, not check the state of the file prior to an extraction attempt and then just assume the extraction was successful.