Capes Notes Objective #7: Explain The Concept of Algorithm: Properties Including
Capes Notes Objective #7: Explain The Concept of Algorithm: Properties Including
CAPES NOTES
Properties including:
A general solution to the problem in a finite number of steps – There should be an exact
number of steps to be taken and has an end.
Clearly defined and unambiguous- Every instruction should be precisely described and
clearly specified.
Flow of control from one process to another- The instructions to be performed should be
performed from top to bottom/ in order.
Flowcharts-
Flowcharts refer to graphical or symbolic representation of an algorithm or process. It is
the diagrammatic representation of the step-by-step solution to a given problem. Each
step in the process is represented by a different symbol and contains a short description of
the process step. The flow chart symbols are linked together with arrows showing the
process flow direction. A flowchart typically shows the flow of data in a process,
detailing the operations/steps in a pictorial format which is easier to understand than
reading it in a textual format. A flowchart describes what operations (and in what
sequence) are required to solve a given problem.
Pseudocode-
Pseudocode is an artificial and informal language that helps programmers develops
algorithms. Pseudocode is an imitation computer program written using Mathematical
notations and English like statements, to describe the logics to solve a problem or carry
Algorithm & Programming
IF or IF-then-else statements. They allow decisions to be made, based on some condition that
evaluates to true. In the case of if-then-else, alternatives are executed if the condition is false.
a. If (A > B) then
Display A
b. If (age >= 50)
Print “Old”
Else
Print “Young”
Algorithm & Programming
Repetition or Loop structures allow statements to be repeated a fixed number of times or until
some condition evaluates to false. If the number of repetitions is known beforehand, the loop
structure is called a counted loop. For example,
c. Repeat 10 times:
Print “I am good-looking”
End-repeat
If the exact number of repetitions is unknown beforehand and is based upon some condition, then
the loop is called a conditional loop. For example,
d. While (price 0) do
Read price
Total = total + price
End-while
Programming paradigms
Programming paradigm refers to the fundamental style of computer programming. It serves as a
pattern or model for a programming language.
The main Paradigms are:
Programming Paradigms Description Programming Language
1. Imperative/ Algorithmic Commands show how the FORTRON
computation takes place, step BASIC
by step. C
2. Functional Control flow is expressed by Haskell Python
Algorithm & Programming