Flowcharts So let’s say we want to express the following algorithm to print out the sum of the biggest and smallest of three numbers
START
Read in A, B and C
START A>B? Read in A, B and C
START A>B? Read in A, B and C Yes A>C?
START A>B? No Read in A, B and C Yes A>C?B>C?
START A>B? No Read in A, B and C Yes A>C?B>C? Biggest = C No
START A>B? No Read in A, B and C Yes A>C?B>C? Biggest = ABiggest = C Yes No
START A>B? No Read in A, B and C Yes A>C?B>C? Biggest = ABiggest = CBiggest = B Yes No
START A>B? No Read in A, B and C Yes A>C?B>C? Biggest = ABiggest = CBiggest = B Yes No
A>B?
Yes B<C?
A>B? Yes B<C?A<C? No
A>B? No Yes B<C?A<C? No
A>B? No Yes B<C?A<C? Smallest = C No
A>B? No Yes B<C?A<C? Smallest = ASmallest = C Yes No
A>B? No Yes B<C?A<C? Smallest = ASmallest = CSmallest = B Yes No
A>B? No Yes B<C?A<C? Smallest = ASmallest = CSmallest = B Yes No
A>B? No Yes B<C?A<C? Smallest = ASmallest = CSmallest = B Yes No Print Smallest + Biggest
A>B? No Yes B<C?A<C? Smallest = ASmallest = CSmallest = B Yes No Print Smallest + Biggest END
Flowcharts So let’s say we want to express the following algorithm to print out the biggest of four numbers
START
Read in A, B, C and D
START A>B? Read in A, B, C and D
START A>B? Yes Read in A, B, C and D X = A
START A>B? No Yes Read in A, B, C and D X = A X = B
START A>B? No Yes Read in A, B, C and D X = A X = B
START A>B? No Yes Read in A, B, C and D X = A X = B C>D?
START A>B? No Yes Read in A, B, C and D X = A X = B C>D? Yes Y = C
START A>B? No Yes Read in A, B, C and D X = A X = B C>D? No Yes Y = C Y = D
START A>B? No Yes Read in A, B, C and D X = A X = B C>D? No Yes Y = C Y = D
START A>B? No Yes Read in A, B, C and D X = A X = B C>D? No Yes Y = C Y = D
X>Y?
Yes Print X
X>Y? No Yes Print X Print Y
X>Y? No Yes Print X Print Y
X>Y? No Yes Print X Print Y END
Symbols
Terminal Input/Output Operation Process Decision Connector Module Symbols