in reply to Modifying loop structure and placement

Some further "challenges" you might consider WRT this and other such exercises:

Replies are listed 'Best First'.
Re^2: Modifying loop structure and placement
by irvson (Sexton) on Dec 30, 2009 at 22:42 UTC

    I don't know what "factor common sub-statemnts" means.

    In several of these exercises I have, in fact, re-worked code, but I'm not ready for any extensive re-working.

    Your last suggestion about using "readmore" is certainly worth considering for some posts. I understand what you're saying. But I'm still at the early learning stage, and posting this longer, non-executable code block allowed me to present a specific problem. When I've learned more, I hope I will be able to follow your suggestion.