Q79. Use stepwise refinement to create a flow chart for this set of instructions: Do A and then B. If C, then while E do F and after that do G, otherwise do H. Do I.
Start by looking at the syntax of the logic to make sure we understand it.
Step 1: do A
Step 2: do B
Step 3: If C, then while E do F and after that do G, otherwise do H
Step 4: do I
Do a first draft that treats step three as a black box.
Next, starting from the outside and working in, we draw the flow chart for "if C do something (the while stuff) otherwise do something else (H)":
And now, let's leave the "while loop" as a black box and fill in a few more details. It's now "if C do the while thing and then do G.
And finally, we'll insert the conditional diamond for the E of the while and a rectangle for the action F.
And then put it all together