Download presentation
Presentation is loading. Please wait.
1
Flowcharts
2
What Is a Flowchart? A diagrammatic representation that illustrates the sequence of operations to be performed to get the solution of a problem. Facilitates communication and understanding ANSI (American National Standards Institute) has defined the symbols and their use Usually drawn in the early stages of formulating computer solutions. helpful in understanding the logic of problems. Makes if easier to write the program/problem it represents In some venues a flowchart is a must for the better documentation of a complex program or problem.
3
Standard Symbols used in a Flowchart
Process symbol Indicates when a computational step occurs Terminal The start or end of the chart Input or output operation Is used whenever data (information that is manipulated or used to manipulate) is added to the program Or Or
4
Standard Symbols used in a Flowchart
Condition or Decision Decision making and branching of code Connector Indicates where a separate part of the code is being addressed Common label is placed within the symbol Flow lines Indicate the flow of logic
5
Standard Symbols used in a Flowchart
Preparation Setting up initial values Off-page connectors Used to connect different parts across pages. Again a common symbol followed by the page it is continued on…. or continued from will identify the different parts (
6
Guidelines when drawing a Flowchart
All steps must be listed in order Clear, neat and easy to follow – should have no ambiguities (super clear) Flow travels top down, or left right Process symbols can only have 1 flow line out.
7
Guidelines continued Only on flow line should enter a decision symbol, but 2 or 3 flow lines may leave Only on flow line with a terminal symbol If the flowchart becomes complex use connector symbols to reduce the number of flow lines (place the section in another space) Yes No
8
Guidelines continued Avoid intersecting flow lines to be more effective and clear Make sure your flowchart has a logical start and finish To test your flowchart, use a simple example and step it through the steps of your algorithm. This should catch any errors in logic.
9
Advantages of Flowcharts
For simple problems, they are a better way to communicate the logic of problem because it is a diagram. Helps in the analysis of a problem Can serve as a good way to document a problem Helps a programmer to code more efficiently and quickly Helps in the debugging process of a problem Helps with identifying where new features of fixes (maintenance) of a program can take place
10
Limitations of a Flowchart
Complex problems cannot be solved with flowcharts because the flowcharts become clumsy and complicated (too hard to follow) Any alterations require a total redraw in most cases Reproducing flowchart symbols can be a pain The detail of the flowchart can mask the real problem we are solving. (Lost in the detail)
11
Example – making tea
12
Make a flowchart that sums all the numbers from 1 to 10
13
Make a flowchart that sums all the numbers from 1 to 10
14
Make a Flowchart describing a person getting woken by alarm and using the snooze button before getting out of bed
15
Make a Flowchart describing a person getting woken by alarm and using the snooze button before getting out of bed
16
Reference locations http://www.nos.org/htm/basic2.htm
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.