Pseudocodes and Flowcharts
Joshua C. Martinez, MIT
Department of Computer Science
Ateneo de Naga University
Pseudocode
An outline of a program, written in a
form that can easily be converted into
real programming statements
Pseudocode cannot be compiled nor
executed, and there are no real
formatting or syntax rules.
Pseudocode
It is simply one step - an important one
- in producing the final code.
it enables the programmer to
concentrate on the algorithms without
worrying about all the syntactic details
of a particular programming language.
Pseudocode
you can write pseudocodes without even
knowing what programming language you
will use for the final implementation.
Pseudocode can almost be classified as
half-code, half-text.
used by a programmer to outline the
algorithms he or she has written, before they
are actually translated into code.
Pseudocode Example
pseudocode to ask the computer to
input two numbers, and then print out
their sum
Get value of A
Get value of B
C=A+B
Display the value of C
Pseudocode Example
Bubble Sort
while not at end of list
compare adjacent elements
if second is greater than first
switch them
get next two elements
if elements were switched
repeat for entire list
Flowchart
A drawing that shows how a program
will operate, the steps that will be
followed, and the order in which they
will be followed
is a representation, primarily through
the use of symbols, of the sequence of
activities in a system (process,
operation, function, or activity).
Flowchart Symbols
Start and End of program
Computational steps or
processing function of a program
Input or output operation
Decision making and branching
Connector or joining of two parts
of program
Flowchart Symbols
Magnetic Tape
Magnetic Disk
Off-Page Connector
Flow Line
Annotation
Display
Flowchart Sample
Draw a flowchart to find
the sum of first 50
numbers.
Problem
Draw a flowchart to find the largest of
three numbers A,B, and C
Flowchart
NO
Problem
Draw a
flowchart for
computing
factorial N (N!)
Where N! = 1 *
2 * 3 * …… N .