Having trouble on solving the following tasks

holmes4:
Now you have working code could you tell us why you used this method? Extra marks may be scored for pointing out the problems with this method and a better solution.

Mark

Umm, i am still working on it...trying to figure out how to use a for loop for this part...