← all problems

sumFile

Given a File containing one integer per line, construct your own Scanner over it and return the sum of every integer in the file. Use a while loop guarded by hasNextInt() — don't assume how many numbers are in the file.