Page 34 - IT_V5.0_Class6
P. 34
Rules for Writing a Good Algorithm
Some of the basic points that we can follow for writing a good algorithm are as follows:
It begins with a keyword “Start”.
It is written using simple English-like statements.
It is not case sensitive i.e. it can be written in uppercase, lowercase or mixed case.
The steps should be simple and easy to understand.
The steps should be in the correct order so that the task can be completed properly.
It must terminate after a finite number of steps.
It ends with a keyword “Stop”
Why Should We Use an Algorithm?
Using an algorithm can help make tasks easier and more organised. Some reasons to use
algorithms are as follows:
It helps you deal with the problem in a simple way.
It helps you find the quickest way to finish a task, like solving a maths problem or organising
your study materials.
It gives clear steps to follow, you are less likely to make mistakes.
It shows you the right way to do something so you can be more accurate.
It is a prerequisite for writing a computer program.
It simplifies the work of generating a program for the computer.
Problem 1: Writing an algorithm to calculate the area of a rectangle.
Step 1: Start
Step 2: Input length L.
Step 3: Input width W.
Step 4: Calculate area as: Area = L × W.
Step 5: Print "Area of the rectangle is Area".
Step 6: Stop
Problem 2: Convert a temperature in Celsius to Fahrenheit using the formula:
F=(C×9/5)+32.
Step 1: Start
Step 2: Input temperature in Celsius C.
Step 3: Calculate Fahrenheit F = (C × 9/5) + 32.
Step 4: Print "Temperature in Fahrenheit is F".
Step 5: Stop
Problem 3: Write an algorithm to find the perimeter of a rectangle.
_____________________________________________________________________________________________________
_____________________________________________________________________________________________________
_____________________________________________________________________________________________________
32 Information Technology (V5.0)-VI

