Help with a homework error (missing identifier)

We're supposed to create a Bank Account class, with a few public functions, and a main function. The main function is supposed to use an array (professor said 2 for his own sake) and pass the array, a count of valid items in the array, and an integer (used for years) b/t 1 & 40 inclusive to a function that will calculate and display the value of each account in the array after the given years.

It still compiles, and it behaves properly for an invalid account number (a non-number or a number < 1000), but if I give it a proper number, I receive "Please enter a valid account number" for 4 lines before asking for another input. I cannot find the logic in my coding that causes this.