Programming Fundamentals
Programming Fundamentals
PROGRAMMING
FUNDAMENTALS
DR. F. O. BOATENG
Contents 1-2
1. Introduction
2. Algorithm
3. Flowchart
4. Pseudocode
Introduction 1-3
Try
for example, consider another algorithm
that displays the product of two numbers:
Algorithm 1-12
Advantages of flowchart
Flowcharts help in analyzing the problems
effectively.
Flowcharts
act as a guide during the
program development phase.
Flowcharts help easy debugging of logical
errors.
Flowchart 1-15
Disadvantages of Flowchart
Alengthy flowchart may extend over
multiples pages, which reduces readability.
Drawing a flowchart using any graphical
tool is a time consuming process.
Thechanges made to a single step may
cause redrawing the entire flowchart.
Flowchart
Symbols used in constructing flowchart
Input/output
Processing
Output
Procedure/Subroutine
Flow lines
Initiator/terminator
On page connector
Flowchart
Symbols used in constructing flowchart (Cont.)
Annotation
This is used to insert comments in a flowchart
Flowchart
Let us see an example flowchart where a number
is accepted and incremented by 1 and the result is
displayed
Pseudocode
Pseudocode is a detailed yet readable description of
what an algorithm must do, expressed in a formally
styled natural language rather than in a programming
language
It is fake code used as a model for programs
It has no syntax rules
It is easy and fast to write as it uses English like
statements
It needs no rewriting if any changes are made in the
steps.
This is because each step is written independent of
the other.
It can be converted to a program by using any
programming language.
Pseudocode
Limitations of Pseudocode
Pseudocode does not provide a graphical
representation of an algorithm; therefore, it
might be difficult to understand the complex
logic in a pseudocode
Pseudocode depicting too many nested
conditions may be difficult to understand
Limitations of
pseudocode
Pseudocode does not provide a graphical
representation of an algorithm; therefore, it
might be difficult to understand the complex
logic in a pseudocode
Pseudocode depicting too many nested
conditions may be difficult to understand
Keyword Usage
THANK
YOU