Beruflich Dokumente
Kultur Dokumente
Flowchart
-
Types of Flowcharts
System Flowchart
A
system
flowchart
is
graphic
representation
of
the
A systems
Flowlines
to
describe
the
computerized
processes,
manual
Program Flowchart
Therefore,
depicting
these
documents
and
operations
are
What it represents
the
preparation
of
variable.
Used to select initial conditions
Used to represent instructions or
Preparation/Initialization
programs
course
of
execution.
Shows input and output. Data are to
be read into the computer memory
from an input device or data are to be
Input/Output
Processing
Signifies any decisions that are to be
done
Two alternative execution paths are
possible. The path to be followed is
DECISION
selected
during
the
execution
by
within
the
outline
is
fulfilled.
Shows the entry or exit point of the
flowchart
A non-processing symbol used to
connect one part of a flowchart to
On-page connector
of
flowlines
in
complex
Flowlines
The following are some guidelines in flowcharting:
a. In drawing a proper flowchart, all necessary requirements
should be listed out in logical order.
b. The flowchart should be clear, neat and easy to follow. There
should not be any room for ambiguity in understanding the
flowchart.
c. The usual direction of the flow of a procedure or system is from
left to right or top to bottom.
d. Only one flow line should come out from a process symbol.
or
e. Only one flow line should enter a decision symbol, but two or
three flow lines, one for each possible answer, should leave the
decision symbol.
Meaning
Addition
Subtraction
Multiplication
Division
Notation
= or EQ
> or GT
< or LT
<> or = or NE
Meaning
Equal to
Greater than
Less than
Not equal to
** or [ or
Exponentiation
>= or GE
Greater
than
or
:
()
|
&
b
Comparison
Grouping
Logical or
Logical and
Blank
<= or LE
Y
N
EOF
equal to
Less than or equal to
Yes
No
End of file
Example 2
Draw a flowchart to find the largest of three numbers A,B, and C.
Example 3
Draw a flowchart for computing factorial N (N!)
Where N! = 1 2 3 N .
Start
Read
Num
Displa
y
Num
End
2.
Draw a flowchart that will compute for the sum of three numbers.
Start
SUM =
A+B+C
Print
SUM
End
3.
numbers.
Start
AVE =
(A+B)/2
Print
AVE
End
4.
Draw a flowchart that will compute for the area of the circle when
Start
Read R
AREA =
3.14*R*R
Print
ARE
A
End
4.
Start
Read F
I = F/12
Print
I
End
Input a,
b
a>
b
Print a,
Highe
r
F
Print b,
Highe
r
End
Input
grade
T
Grade>=
60
Print
grade,
Passe
d
F
Print
grade,
Failed
End
Input num
Num
>0
F
Print
Negativ
e
Print
Positiv
e
End
Bon
us =
0
Read
Name,
Salary
T
F
Salar
y<
2000
Bonus = 0.50* Salary
Print Name,
Bonus
End
Bonus =
1500
5. Draw a flowchart that will input values for a and b. Compare two
values inputted and print which of the values is higher including the
remark Lower.
Start
Input a,
b
a<
b
Print a,
Lower
F
Print b,
Lower
End
number.
Start
C=0
F
C<
10
End
T
C = C+1
Print
C
2.
number.
Start
C=5
F
C
=0
End
T
C = C-1
Print
C
3. Draw a flowchart that will count from 1 to 10 and get the sum of
the numbers. Print each number and the sum of the numbers.
Start
C=0
Sum =
0
F
C<
10
Prin
t
Su
m
End
C = C+1
Sum = Sum
+C
Print
C
3. Draw a flowchart that will count from 1 to 5 and get the average of
the numbers. Print each number and the average of the numbers.
Start
C = 0, Sum
=0
Ave = 0
F
C<
10
Ave =
Sum/10
Prin
t
Ave
End
T
C = C+1
Sum = Sum
+C
Print
C
2. The initial value of the radius (R) of a circle is equal to 1 unit and
each succeeding radius is 1 unit greater than the value before it.
Draw a flowchart to compute the area of the circle starting with R=1
Start
Pi =
3.11416
R=1
Area = Pi*R*R
Print R,
Area
R = R+1
F
R<
=5
End
3. Draw a flowchart that will compute for the sum of the odd numbers
from 1 to 10.
Start
End
CTR =
1
SUM =
0
Print
SUM
CTR
mod 2
=1
SUM = SUM
+ CTR
CTR = CTR+1
Y
N
CT
R
=
10
CTR = CTR + 1
A
A
4. Draw a flowchart that will count the sum of all even numbers from
1 to 10.
Start
End
CTR =
1
SUM =
0
Print
SUM
CTR
mod 2
=1
SUM = SUM
+ CTR
CTR = CTR+1
Y
N
CT
R
=
10
CTR = CTR + 1
A
A
5. Draw a flowchart that will read and print the names and individual
scores of 100 students for a particular examination. Also, determine
their average score, and print it out.
Start
CTR = 0
SUM = 0
A
Read
Name,
Score
Print
Name,
Score
SUM = SUM +
SCORE
CTR = CTR +
1
CT
R
=
10
0
AVE =
SUM/CTR
Print
AVE
END
more likely to occur when there are nested loops or loops contained
within other loops.
Counters
For instance, if a
program is supposed to read and print five data values, a counter may
be set up in the program which counts the number of data values;
after a data value is read and printed, the counter is increased by one.
Before a new data value is allowed to be read, a conditional transfer
may be used to determine whether or not the desired amount of data
has been reached. If it has, the program is terminated; otherwise an
unconditional transfer causes the computer to repeat the input/output
and other processing operations.
Illustrative Problem.
Given a set of 5 numbers that include both positive and negative
data values. Draw a to read in these values one at a time and count
the number of positive values (including zero values) and the number
of negative values found in the set.
Start
NNEG = 0
NPOS = 0
Read
NO
NNEG = NNEG + 1
N
N
O
<
0
B
NVAL = NNEG +
NPOS
N
A
Y
NV
AL
=5
NPOS = NPOS + 1
Print
NNEG,
NPOS
End
The
K=1
SUM = 0
A
SUM = SUM + K2
K=K+1
Y
A
K<=1
00
Print
SUM
End
Illustrative Problem
With the use of switches, draw a flowchart to determine and
print out the sum of all even and odd integers from 1 to 10.
Start
SW =
0
NUM =
1
SUMEVN = 0
SUMODD = 0
A
SUMODD = SUMODD
+ NUM
N
SW
=0
SW =
0
SW =
1
Y
A
Print SUMEVN,
SUMODD
NU
M=
10
N
NUM = NUM +
1
B
looping continues.
element read into memory can then be recalled from memory anytime
when needed for processing.
Illustrative Problem
Draw a flowchart to read into memory a given set of numbers (onedimensional array) and determine the smallest value in the set.
Start
B
I=1
Define the Aarray
4
4
I=2
AMIN =
A(1)
N
Read
N
AMIN
<=A(
I)
AMIN = A(I)
Read
A(I)
I=I+1
I = I+1
N
3
3
N
I>
N
I>
N
Y
B
Print
AMIN
End
4
4
The process of
reading each element is done within the loop until all values are read
into memory.