0% found this document useful (0 votes)
18 views4 pages

Flow Chart Example for Algorithms

The document explains the use of program flow charts to represent algorithms, highlighting various symbols such as PROCESS, INPUT/OUTPUT, DECISION, START/STOP, and ARROW. It describes different looping structures, including repeat loops and while loops, as well as conditional statements like IF…THEN and IF…THEN…ELSE. An example algorithm is provided to illustrate how these concepts can be visually represented in a flow chart.

Uploaded by

tbotshelo994
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views4 pages

Flow Chart Example for Algorithms

The document explains the use of program flow charts to represent algorithms, highlighting various symbols such as PROCESS, INPUT/OUTPUT, DECISION, START/STOP, and ARROW. It describes different looping structures, including repeat loops and while loops, as well as conditional statements like IF…THEN and IF…THEN…ELSE. An example algorithm is provided to illustrate how these concepts can be visually represented in a flow chart.

Uploaded by

tbotshelo994
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

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

You might also like