At first, we will draw a rectangle and write while in it. Then draw a line to its right and use the decision symbol i.e. diamond diagram. Write the loop condition in the diamond and draw a line down to diamond which represents the flow when the decision is true. All the repeated processes are drawn here using rectangles. Then a line is drawn from the last process going back to the while and decision connection line. We have a line on the right side of diamond which is the exit of while loop. The while loop terminates, when the loop condition evaluates to false and the control gets out of while structure.
So far, we have been drawing flow charts after coding the program but actually we have to draw the flow chart first and then start coding.
For previous lesson click here: Properties of while loop
For next lesson click here: While Sample Program
the easiest way to learn programming
introduction to programming
While Flow Chart
0 comments:
Post a Comment