Improved printPrimes()

1. On line 106, pageNumber is now incremented in a more straight-forward way.

2.Changed the name of the variable pageOffset to rowOffset to make its purpose clearer.

3. Introduced a String variable named pageTitle. Instead of constructing the page title string each time in the loop, only the page number needs to be added to it.

4. Introduced variable primesPrintedSoFar to replace row + col * maxRowsPerPage.

5. Introduced method calculatePrimesPrintedSoFar() to replace repeated computation row + col * maxRowsPerPage.

6. Introduced method isEndReached() to check if the end of the list containing the primes has been reached. This makes the code easier to understand.