Program Flow Charts
They are used to represent algorithms and they can be used instead of pseudo code.
Symbols
PROCESS – Program instruction(s) that transform input(s) into
output(s)
INPUT/OUTPUT
Used to where data input and output is to be performed
DECISION
Used where a decision has to be made in selecting a subsequent
path to follow. There is only one entry point and two exit points.
START/STOP
Used as the first and last symbol in a program
ARROW
Used to show the flow/path of a sequence of symbols. Vertical
without arrow heads are assumed to flow from top to bottom and
horizontal line without arrow heads are assumed to flow from
left to right.
Repeat Loop
1
Note that the repeat loop has the process preceding the decision. This means the repeat
loop will always execute the process part at least once.
SEQUENCE
DECISIO
FALSE N
TRUE
While loop
The while loop is basically the reverse of the repeat loop, the decision comes first ,
followed by the process. The while loop is usually written so that it iterates while the
condition is true, but the repeat iterates until the condition becomes true.
DECISIO
N
True
False
SEQUENCE
2
The IF…THEN statement is also known as the NULL ELSE, meaning that there is no
ELSE part.
False True
?
Conditio
n
Process
The IF..THEN…ELSE statement has a process at each branch of the decision symbol.
Each value of the decision(TRU/FALSE) has a process associated with it.
False ? True
Conditio
n
Process 2 Process 1
3
Example
The algorithm below can be represented using a program flow chart.
Read X, Y
IF X <Y then
Smaller = X
ELSE
Smaller = Y
ENDIF
Print Smaller
Begin
Read x, y
X<
Y?
Yes No
Smaller = X Smaller = Y
Print Smaller
END