in reply to Homework Problems
A good first step is to add a little indentation and white space so you can more easliy see the control structures and flow of the program. A little like using sentence and paragraph structure in prose. Consider this:
Start G = 18 H = 2 I = 13 if H = 2 perform Change-GI endif while I > 7 perform Change-HI endwhile if G = 2 then perform Change-G endif if I = G then perform Change-G else perform Change-HI endif print G, H, I End Change-GI while I > 5 I = I - 3 G = 0 endwhile Return Change-HI H = H + 2 I = I - 4 Return Change-G G = G + 1 H = H - 1 Return
|
|---|