









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
An overview of structured programming, focusing on the problem-solving and implementation phases. It introduces the concept of algorithms, their properties, and the challenges in writing them. The document also covers the development and understanding of algorithms using flowcharts and a problem example.
What you will learn
Typology: Lecture notes
1 / 17
This page cannot be seen from the preview
Don't miss anything!
Two phases involved in the design of any program: (i) Problem Solving Phase (ii) Implementation Phase
e.g. preparing a meal or student daily routine
Properties of an Algorithm:
Algorithms and Humans
Algorithms are not a natural way of stating a problem’s solution, because we do not normally state our plan of action.
Understanding the Algorithm
Possibly the simplest and easiest method to understand the steps in analgorithm, is by using the flowchart method. This algorithm is composed of block symbols to represent each step in the solution process as well as the directed paths of each step. The most common block symbols are:
There are many other block symbols, used in flow charting, but for the purposes of this course, we will restrict our usage to the symbols described above. They are sufficientto illustrate the steps in developing solutions to the simple problems we will be dealing with.
Problem Example 1
(i) Find the average of a given set of numbers.
Make note of what you did in steps (i) through (iv), but how you did it. In doing so,
you will begin to develop the algorithm.
e.g. How do we count the numbers?
and so on , until you reach the end of the list
How do we add numbers?
How do we compute the average?
If list is empty, we do not want to compute average.
Therefore, before calculating AVE, check if COUNTER = 0
i.e. If COUNTER = 0 then AVE = 0 else AVE = SUM/COUNTER
Algorithmic Structure Every algorithm should have the following sections, in the stated order: