Algorithm Design and Problem-Solving
Algorithm Design and Problem-Solving
7
Algorithm Design and
Problem-Solving
Banani International School © 2025 - 0478
0478/Banani/2015/Student Notes
LESSON OBJECTIVES
1. Understand the program development
life cycle, limited to: analysis, design,
coding and testing
2. (a) Understand that every computer
system is made up of sub-systems,
which are made up of further
sub-systems
(b) Understand how a problem can be
decomposed into its component parts
LESSON OBJECTIVES
(c) Use different methods to design and
construct a solution to a problem
3. Explain the purpose of a given
algorithm 4. Understand standard
methods of solution
7.1
The program development life
cycle
Banani International School ©2025 - 0474
✔The program
development life cycle
is divided into five
stages: Analysis,
Design, Coding, Testing
and maintenance.
✔In this lesson will only
consider four stages
1. analysis
2. design
3. coding
4. testing
7.1.1
Analysis
Banani International School ©2025 - 0474
✔Before any problem can be
solved, it needs to be clearly
defined and set out so anyone
working on the
solution understands
what is needed.
✔This is called the
‘requirements specification’ for
the program. ✔The analysis
stage uses abstraction and
decomposition tools to identify
exactly what is required from the
program.
✔Abstraction keeps the key
elements required for the
solution to the
problem and discards
any unnecessary details
and information that is not
required.
✔For example, a map
only shows what is
required for travelling
from one place to
another.
✔Decomposition breaks
down a complex problem
into smaller parts, which
can then be subdivided
into even smaller parts,
that can be solved easily.
For example,
getting dressed:
✔Select items to
wear ✔Remove
any clothes
being worn
✔Put selected
items on in
order
7.1.2
Design
This can be
formally
documented
using
structure
charts,
flowcharts
and
pseudocode
7.1.3
Coding and iterative testing Banani
Testing
Banani International School ©2025 - 0474
✔The completed
program or set of
programs is run
many times with
different sets of test
data. This ensures
that all the tasks
completed work
together as
specified in the
program design.
7.2.1
Class
Activity 1
Using one of the computer systems
that you identified, decompose it into
its component parts of inputs,
processes, outputs and storage
7.2.3
✔To show
top-down
design in a
diagrammatic form,
structure diagrams
can be used.
✔with each level
giving a more
detailed
breakdown of the
system into
sub-systems.
STRUCTURE
DIAGRAM shows
the design of a
computer system
in a hierarchical
way,
with
each
level
giving
a
more
detailed
breakdown of the
system into
sub-system
Alarm
app for a smartphone
Activity 2
1. Draw a structure diagram for borrowing a book
from the school library.
2. Draw a structure diagram for making and
serving coffee.
3. Using a structure diagram illustrate the
process of ordering a burger, with options of
fries and drink or both or non
Borrowing a Book from a school library
Borrowing a
Book
Book
Member Non
Secondary Primary Text Book Non Text
Member
Flowcharts Banani International School ©2025 - 0478
✔A Flowchart shows
diagrammatically the
steps required for a
task (sub-system)
and the order that
they are to be
performed.
✔These steps together
with the orders are
called an
ALGORITHM
2.2.1
PROBLEM-SOLVING & DESIGN
ALGORITHM
WHAT IS AN ALGORITHM?
1. An algorithm is
simply a sequence
of instructions
written to solve a
given problem.
2. Or A set of steps to
get you from State A
to State B.
3. Is a sequence of
steps to solve a given
problem or execute a
given task.
Flowcharts are drawn
using standard
flowchart symbols. 1.
Begin/End
Terminator
flowchart symbols
are used at the
beginning and end
of each flowchart.
2. Process
Process flowchart
symbols are used to
show actions, for
example, when
values
are assigned to
variables. If a
process has been
defined elsewhere then
the name of that
process is shown.
3. Input and
output The
same
flowchart
symbol is
used to show
the input of
data and
output of
information.
4. Decision
Decision flowchart symbols are used to decide which
action is to be taken next; these can be used for
selection and repetition/iteration. There are always two
outputs from a decision flowchart symbol.
Yes/no
5. Flow lines
Flowchart flow
lines use arrows
to show the
direction of flow,
which is usually,
but not always,
top to bottom and
left to right.
Think of a
Number
Write down the
Number Multiply
Even? by three
YES
and add
Divide number by Number one
the two NO
Is
NO
Answer One
NO
YES
Is
STOP
Class
Activity 4
Flowchart
Class Activity 4
0478