Download presentation
Presentation is loading. Please wait.
Published byJayson Carter Modified over 9 years ago
1
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
2
START
3
Read in A, B and C
4
START A>B? Read in A, B and C
5
START A>B? Read in A, B and C Yes A>C?
6
START A>B? No Read in A, B and C Yes A>C?B>C?
7
START A>B? No Read in A, B and C Yes A>C?B>C? Biggest = C No
8
START A>B? No Read in A, B and C Yes A>C?B>C? Biggest = ABiggest = C Yes No
9
START A>B? No Read in A, B and C Yes A>C?B>C? Biggest = ABiggest = CBiggest = B Yes No
10
START A>B? No Read in A, B and C Yes A>C?B>C? Biggest = ABiggest = CBiggest = B Yes No
12
A>B?
13
Yes B<C?
14
A>B? Yes B<C?A<C? No
15
A>B? No Yes B<C?A<C? No
16
A>B? No Yes B<C?A<C? Smallest = C No
17
A>B? No Yes B<C?A<C? Smallest = ASmallest = C Yes No
18
A>B? No Yes B<C?A<C? Smallest = ASmallest = CSmallest = B Yes No
19
A>B? No Yes B<C?A<C? Smallest = ASmallest = CSmallest = B Yes No
20
A>B? No Yes B<C?A<C? Smallest = ASmallest = CSmallest = B Yes No Print Smallest + Biggest
21
A>B? No Yes B<C?A<C? Smallest = ASmallest = CSmallest = B Yes No Print Smallest + Biggest END
22
Flowcharts So let’s say we want to express the following algorithm to print out the biggest of four numbers
23
START
24
Read in A, B, C and D
25
START A>B? Read in A, B, C and D
26
START A>B? Yes Read in A, B, C and D X = A
27
START A>B? No Yes Read in A, B, C and D X = A X = B
28
START A>B? No Yes Read in A, B, C and D X = A X = B
29
START A>B? No Yes Read in A, B, C and D X = A X = B C>D?
30
START A>B? No Yes Read in A, B, C and D X = A X = B C>D? Yes Y = C
31
START A>B? No Yes Read in A, B, C and D X = A X = B C>D? No Yes Y = C Y = D
32
START A>B? No Yes Read in A, B, C and D X = A X = B C>D? No Yes Y = C Y = D
33
START A>B? No Yes Read in A, B, C and D X = A X = B C>D? No Yes Y = C Y = D
35
X>Y?
36
Yes Print X
37
X>Y? No Yes Print X Print Y
38
X>Y? No Yes Print X Print Y
39
X>Y? No Yes Print X Print Y END
40
Symbols
42
Terminal Input/Output Operation Process Decision Connector Module Symbols
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.