1
, ALGORITHMS AND FLOWCHARTS
A typical programming task can be divided into two
phases:
• Problem solving phase
– produce an ordered sequence of steps that describe solution
of problem
– this sequence of steps is called an algorithm
• Implementation phase
– implement the program in some programming language
2
, Steps in Problem Solving
• First produce a general algorithm (one can use
pseudocode)
• Refine the algorithm successively to get step by
step detailed algorithm that is very close to a
computer language.
• Pseudocode is an artificial and informal language
that helps programmers develop algorithms.
Pseudocode is very similar to everyday English.
3
, The Flowchart
Program flowcharts show the sequence of
instructions in a single program or subroutine.
Different symbols are used to draw each type of
flowchart.
A Flowchart
– shows logic of an algorithm
– emphasizes individual steps and their
interconnections
– e.g. control flow from one action to the next
4