Your outer-loop involving lineCount seems right. Consider only this outer-loop:



Within the // do something part, you should write something similar for your loop involving the count variable....