Title: Flowcharts
1Flowcharts Algorithms
2Steps in using a computer as problem solving tool
- Develop an Algorithm and a Flowchart.
- Write the program in programming language (C,
C, JAVA, COBOL, etc.). - Enter the program in computer.
- Test and Debug the program.
- Run the program, input data, and get the result
from the computer.
3What is ALGORITHM?
- Definition Algorithm is a step by step procedure
to solve a problem (Finite steps). - Algorithm can be presented or written in Words.
- Algorithm can be represented diagrammatically in
Flowchart.
4The Flowchart
- Dictionary) A schematic representation of a
sequence of operations, as in a manufacturing
process or computer program. - (Technical) A graphical representation of the
sequence of operations in an information system
or program. Information system flowcharts show
how data flows from source documents through the
computer to final distribution to users. Program
flowcharts show the sequence of instructions in a
single program or subroutine. Different symbols
are used to draw each type of flowchart.
5The Flowchart
- A Flowchart
- shows logic of an algorithm
- emphasizes individual steps and their
interconnections - e.g. control flow from one action to the next
6Symbol
Terminal Symbol indicates the starting or
stopping pointin the logic.
Input/Output Symbol Represents an input or
output process in an algorithm
Process Symbol Represents any single process in
an algorithm
Predefined Process Symbol
Decision Symbol Represents a decision in the
logic involving the comparison Of two values.
7The three basic control structures-
- Sequence
- Selection
- Repetition
81. Sequence
Statemement a
Statemement b
Statemement c
9Example
- Algorithm
- Step 1 Input W,L
- Step 2 A ? L x W
- Step 3 Print A
102. Selection
Condition p?
T
F
Statemement a
Statemement b
11Example
Step 1 Input M1,M2,M3,M4 Step 2 GRADE ?
(M1M2M3M4)/4 Step 3 if (GRADE lt50) then
Print FAIL else Print PASS endif
PRINT PASS
12Selection (2)
Condition p?
F
T
Statemement a
133. Repetition
Condition p?
F
T
Statemement block
14Example
Algorithm Flowchart
Start Design the Software. Use the Design for Code. Test the Software. If error If error is Design Then correct the Design Else Correct the Code Stop