0% found this document useful (0 votes)
172 views3 pages

Flowchart Symbols

The document discusses flowcharts which are diagrams used to represent algorithms visually. Flowcharts use standard symbols like rectangles, ovals, diamonds and parallelograms connected by arrows to show the flow of an algorithm. An example flowchart is given to find the sum of three numbers which uses the basic symbols.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
172 views3 pages

Flowchart Symbols

The document discusses flowcharts which are diagrams used to represent algorithms visually. Flowcharts use standard symbols like rectangles, ovals, diamonds and parallelograms connected by arrows to show the flow of an algorithm. An example flowchart is given to find the sum of three numbers which uses the basic symbols.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Flowcharts

Flowcharts
Flowcharts are diagrams used to help us visualise the sequences
of algorithms. They use a set of symbols with a little text in each
Simple tasks have simple flowcharts and complex tasks can have
flowcharts with thousand of components. They are especially
useful for novice programmers if they can fit on one page; however,
Start
if they take up several pages they become difficult to follow and
may be ineffective. Programmers use many different symbols to
draw flowcharts but we will start with four basic symbols that are
Connected by arrows.

Rectangle -

process to be performed, for


Input the example, arithmetic
three numbers

Oval- the Start and End boxes

Lalculate the total

Diamond - decision or question boxes

Display the total Parallelogram a n input or output

operation

Arrow denotes the flow or path of the


algorithm, that is, where to go next after
an operation has been caried out
End

oI inding the sum of three numbers and


So, if we take our example
the three numbers, we can make a flowchart
Figure 12.5 Flowchart: Finding the displaying the sum of
as shown in Figure 12.5.
SUm of three numbers

217
Programming

What do you want to do Verblconstruct to use Example of how to use it


Input data INPUT INPUT name
READ name
TO 9.14 or
READ
List THREE keywords (verbs) that
may be used as instructions for ASsign a new value to a variable STORE, =or STORE age1 TO age
outputting information when or initialise a variable age =age1
writing pseudocode age=age1
Output data and information OUTPUT OUTPUT Please enter a numbe
PRINT PRINT 'End of processing
OUTPUT total
WRITE WRITE The total is , tota
Repeat a statement or set of FOR. DO FOR COunter= 1 to 5 DO
statements a fixed number of OUTPUT COunter
times ENDFOR
Repeat a statement or set of REPEAT. UNTIL total = 0

statements based on a condition REPEAT


that is tested before oop entry. INPUT coin
Loop must execute at least once total = total + coin
UNTIL (total >= 20)
Repeat a statement or set of WHILE DO COunter =

statements based on a condition WHILE (counter < 5) DO


that is tested before loop entry. OUTPUT counter
Loop may not execute cOunter = COunter1
ENDWHILE
Make a decision with one IF-THEN IF (x> 5) THEN
possible action PRINTx
ENDIF
Make a decision with two IF-THEN-ELSE IF (passMark> 50)THEN
possible actions PRINT 'Pass
ELSE
PRINT 'Fail
ENDIF

Table 9.12 Summary of the verbs and control structures used when writing pseudocode
There are lots of examples ot pseudocode coming up in the following section. bu
now let us look at an alternative way to represent an algorithm: flowcharts.

TO9.15
Watch a video that
Using flowcharts to represent algorithms
introduces flowcharts. A flowchart is a pictorial way of representing an algorithm using a set of stanaar
What is a rhombus symbols (shapes).
shape used for in a Flowcharts use different symbols to represent
input, processing and ouip
flowchart? operations. Operations are connected with arrows which serve as flow lines.
Flowcharts are usually drawn from top to bottom or left to right. tis importan
that the symbols are used as intended so that the completed flowchart is clear
the programmers. Examples of correct usage of the five standard flowchart symbos
are shown below.
ITQ 9.16 Each flowchart should have only two terminal symbols. The first one sno
Which is the only flowchart symbol be labelled either 'Begin' or "Start and the other labelled either "End or 'Stop
which MUST be used at least twice Begin' and 'End' will be used in all flowcharts in this chapter. This will help t
in every flowchart? easily convert the algorithms to program code later.

270
9 Problem-solving and program design

Process Symbol Description


Terminal Terminators show the start and stop points in a process.
Use only TWO terminators for EACH flowchart.
Label the first terminator BEGIN and the second one END.
Input/Output Parallelogram.
This symbol indicates inputs to and outputs from a process.
The shape must be labelled with either INPUT or OUTPUT
Process Rectangle.
Program instruction(s) that transform(s) input(s) into
output(s) are recorded here.
Each symbol MUST be labelled with an operation that
includes the assignment operator (or=).
Decision Rhombus.
Indicates a question or branch in the process flow; for
example x> 0?
No need to write the words IF...THEN' in the shape.
Label one branch Yes and the other No.
indicate the direction in
Flowlines Flowlinesjoin flowchart symbols and
which the process floWS

Table 9.13 Flowchart symbols and their meaning and usage

TO9.17
What isthe purpose of flowlines in
The input/output symbol is used to document data that is coming in or going out
of the program. If multiple data items are being input or output one after the other
a flowchart? then include them in the same symbol.

Figure 9.7 A data (input/output) symbol must be


Output labelled with input or output as well as the variable
input 'Amount in till', or variables
fare

The process symbol is used to show variables being initialised to starting values
The
and variables being assigned new values provided by an arithmetic operation.
following are all valid labels:
STORE 1 TO X
X = I

X I
X:= 1
We will use the
='as our assignment symbol in all our flowcharts.

COunter = 0
cOunter =
average
sum = 0 COunter +1 total/counter

Initialising variable Adding 1 to a counter A division operation

Correct labelling of the process symbols. Note that each symbol has only one flow line entering and
Figure 9.8
one leaving

symbol is used when ihe flow can miss out a process or pass to one
The decision
of iwo possible processes depending on a condition.
While there are very firm rules governing the
no labelling of the decision
symbol, good practicc suggests that you should label the:

271

You might also like