You probably don't want a while-loop and a for-loop for this program. Just keep the outer most do-while and one of those other (inner) loops.
(If I might infer from your code: you don't seem to quite "get" the for-loop, so trash it and just use the while one; you can try the for loop and a smaller program with hard coded values so you can better understand it.)