Professional Documents
Culture Documents
JERRY ESPERANZA
Objective
The module was designed to achieve the following;
What covered on this material are program flowcharts. System flowcharts are
designed to show interface between input/output devices, to other systems, and the
program itself. It uses other specialized symbols which are beyond the coverage of this
courseware.
Though new tools are being introduced in software development, flowcharting is still
one of the effective tools in presenting the logic/idea of program execution. Students of
Computer Science or related IT courses will benefit on this courseware as one prepares
career as Scientist, Analyst, Programmer or Project Manager.
We encourage everyone to give us feedback on how you find this material so we may
improve it. You may reach us at thrivingJerry@yahoo.com. Visit also our blogsite:
http://ThrivingAndLiving.blogspot.com .
http://ThrivingAndLiving.blogspot.com 2
Flowcharting as Algorithm Tool
Algorithm is a step-by-step procedure in solving a problem. It may be expressed in a
human language, pseudocode (not a real code), and/or with flowcharts. Flowchart is the
graphical representation of the algorithm.
It is strictly enforced to use an arrow head at the end of the flow lines. It helps to
know which direction the flowchart is heading. Process box denotes action.
Solution:
Start
Terminal symbol is
required to use at start
* and end of flowchart
End
http://ThrivingAndLiving.blogspot.com 3
Decide which path to take
Problem B gives us a dose on how to deal with decision. The diamond symbol represents
a condition normally answered by yes or no, true or false. A path is taken and determine
the next step to do depending on the answer set by the condition.
Solution 1
Start * Decision box
branches to the next
instruction depending
on the result of
condition.
Slow down at
intersection.
** On-page connector
used to direct at the next
instruction WITHIN the
page. Label it either by
letter or number or
Check traffic light
combination of both.
signal.
*
**
Signal = Y Continue driving.
green? C
N
C
End
http://ThrivingAndLiving.blogspot.com 4
Solution 2
We can solve the same problem using a different approach. No need to test if the
signal is yellow. We can logically assume that if it is not green, two conditions would
remain: either red or yellow. Green is tested first; red next. Therefore, neither green nor
red, we proceed immediately to step when the color is yellow. Thus, we eliminate the
condition of testing yellow.
Start
Slow down at
intersection.
Prepare to stop.
End
http://ThrivingAndLiving.blogspot.com 5
Initialize your Storage
Algebra uses literals (x and y variables) in solving an equation. In programming,
variables or identifiers are treated as memory storage. We need to name (and initialize) it
at the start of every program. Just like in an algebraic equation, the value of these
identifiers varies as the execution of the program progresses.
Solution`
Start
Initialization or
x=3 preparation stores the
y=4 start value of identifiers
z=0 or variables at the start of
the program
z= x+y
Input/Output box
Y Display
used as an I/O
z < 10 “Sum is less function which
than 10” makes data available
for processing
N (input) or displaying
(output) of processed
End information.
http://ThrivingAndLiving.blogspot.com 6
Break Large Task into Small Tasks
We may run not just into steps but series of steps. This would be a dilemma for
programmers and analysts if they are working on larger systems. It would hard for them
to contain the problem if something goes wrong. One way to avoid this kind of situation
is to modularize inter-related tasks into one package.
Subtasks are smaller programs within a program. That is why it starts and ends
with terminal symbols. Instead of the START/END texts inside these terminal symbols,
the name of subtask is indicated; RETURN signals the end of the execution within
subtask and returns to the calling program.
Solution:
Start
subtractNumbers
End
http://ThrivingAndLiving.blogspot.com 7
addNumbers
A
x=0 y= y+1
y=0
x= x+1
Accept x
Print the
Accept y value of x.
A RETURN
subtractNumbers 1
z = -4 Y
z <-4 z=z+2
N
z=z-1
z=z-1
Print the
Off-page connector is value of z.
used to direct the next
instruction located on
ANOTHER page. Label it
either by letter or number
or combination of both. RETURN
Page 1 Page 2
http://ThrivingAndLiving.blogspot.com 8
Connectors used on loops
We can see on the solution of Problem E how connectors are utilized in doing repetitive
tasks. Connectors are best applied when loops occur in the program.
Display
value of
start = 1 finish
finish = 4
finish = finish - 1
Y Display
start < 4 value of
start
N B
Display
value of start = start + 1
finish
Display Y
value of finish> 0
start A
End
finish = 4 C
http://ThrivingAndLiving.blogspot.com 9
Common Flowcharting Error
1. Hanging process. This is a common error where the designer left process or
predefined box hanging and does not specify the next task to do. Use may use
flow lines or connectors to correct this problem.
Y
green? Y green?
Continue Continue
driving. driving.
N N
NO! YES
2. Decision box with three-outgoing branch. You may notice from other
textbooks the use of 3-outgoing branch. Because this material is used as
introduction to programming, stick with the use of 2-outgoing branch for now.
The decision box on this case is designed only to answer conditions with YES or
NO; TRUE or FALSE.
NO NO
NO! YES
http://ThrivingAndLiving.blogspot.com 10
3. Too many end terminal symbols. Flowchart designers who are lazy to route the
next step to END often create more than one terminal symbol. Remember always
that you are only allowed to have one set of START/END terminal symbols in a
flowchart. Again, you may correct this error by using flow lines or connectors.
Signal = Y Signal = Y
Continue Continue
green? green?
driving. driving.
End A
N N
Signal = Y Signal = Y
Press brake. Press brake.
red? red?
N
N
A
End End
NO! YES
http://ThrivingAndLiving.blogspot.com 11
Problem Exercises
I. Design a flowchart based from the given tasks.
1. Show steps on how to withdraw money from ATM. Include situation of what to
do when machine captures your ATM card.
http://ThrivingAndLiving.blogspot.com 13