Chapter7: Algorithm and Problem Solving
Program development life cycle
Program development life cycle is a series of structure step/activities that are followed to create a
computer program
There are several types of life cycle, these includes Analysis, Design, Coding and Testing
Analysis – the first stage of the program development life cycle that involves investigating the
problem
Abstraction: keeps the key elements required for the solution to the problem and discards
any unnecessary details and information that is not required.
Decomposition: taking a system and splitting it into smaller sub-systems, which can in turn
be split into smaller sub-systems
Decomposition has four components, they are: Input, process, output and storage
Design – The program specification from the analysis stage is used to show as to how the program
should be developed. This can be formally documented using structure diagrams, flowcharts and
pseudocode
Methods used to design and construct a solution to a problem
Solutions to problems need to be designed and developed rigorously. The use of formal methods
enables the process to be clearly shown for others to understand the proposed solution. The
following methods need to be used;
Structure diagrams
Flowcharts
Pseudocode
Structure Diagrams
Structure diagrams: a hierarchical diagram that shows the decomposition of a system
Example1:
A calculator needs to allow the user to enter numbers and the symbol, calculate the result and
output this.
Example2:
Flow chart
A flowchart is a diagrammatic representation of an algorithm