ADS CH 2 - Flowcharts
ADS CH 2 - Flowcharts
Algorithms and
Data Structures
Course 2
Flowcharts
1 11/6/2017 9:18 PM
2 2
Flowcharts
START
STOP
5 5
NO YES
condition
8 8
expression
9 9
Structured programming
sequence 1 BEGIN
sequence 1;
sequence 2
sequence 2;
……………. ……..
sequence n;
sequence n END
16 16
NO YES NO YES
condition condition
sequence 1 sequence 2
CASE expression OF
expression
value 1 : sequence 1
v1
v2 vn value 2 : sequence 2
seq. 1 seq. 2 ……. seq. n def. seq. .......
value n : sequence n
ELSE: default sequence
ENDCASE
20 20
WHILE condition
YES
condition sequence
ENDWHILE
NO sequence
22 22
sequence sequence
YES NO
condition condition
NO YES
DO DO / REPEAT
sequence sequence
WHILE condition UNTIL condition
23 23
v = vi FOR v = vi TO vf STEP vs
sequence
ENDFOR
YES
v ≤ vf where:
v – the loop variable (counter)
NO sequence
vi – the initial (starting) value
vf – the final (ending) value
v = v + vs
vs – the step value
24 24
The END