In both loops, you're reading a line, and checking to make sure it's not null. Then you're immediately reading another line, ignoring the line you read first, and not checking the newly read line for...