Page 57 - Viva ICSE Computer Studies 8 : E-book
P. 57
Step 3: Compare the numbers. If X is smaller than Y, go to Step 4, else go to Step 5.
Step 4: Print “X is smaller”.
Step 5: Print “Y is smaller”.
Step 6: Stop.
Characteristics of an Algorithm
A good algorithm should possess the following features.
• Input: An algorithm must have an input.
• Defi niteness: Each step of an algorithm must be written in a simple and precise manner
so that it is easy to understand.
• Uniqueness: There should be no repetition of steps.
• Finiteness: Each algorithm should include fi nite number of steps.
• Output: After all the steps are executed, the algorithm should provide the desired result.
Flowcharts
A fl owchart is a pictorial representation of steps of an algorithm used for solving a particular
problem. In a fl owchart, each operation is represented by drawing a specifi c geometric shape
and each fl owchart symbol is connected by arrows. Let’s learn about the standard symbols
used in a fl owchart.
Symbol Name Function
Start/Stop An oval is used to indicate the beginning and the end point.
A parallelogram is used to indicate the acceptance of inputs from
Input/Output
a user or the output concluded.
The arrows are connectors that connect various geometrical
Arrows shapes. The direction of the arrows represents the fl ow of the
sequence.
Process A rectangle represents steps involving processing of data.
A diamond represents steps involving decision to be taken on
Decision Box
the basis of a specifi c condition.
Connector A circle is used to connect one part of a flowchart to another.
Advantages of Flowcharts
• Communication: Flowcharts are a better way of communicating the logic of a system.
• Eff ective Analysis: Problem can be analysed in a more eff ective way using the fl owchart.
45