recognizes nonnegative numbers, puts into number array, and recognizes various symbols