0% found this document useful (0 votes)
68 views3 pages

UNIT 6 g10

Uploaded by

tmengistutk1970
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
68 views3 pages

UNIT 6 g10

Uploaded by

tmengistutk1970
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

UNIT 6

FUNDAMENTALS OF PROGRAMING
At the end of this unit, learners will be able to:

 Explain concepts of algorithms.


 Describe the representation of algorithms.
 Discuss Integrated Development Environment (IDE).

In this unit, you are going to learn basics of algorithm, definition of algorithm, characteristics
of algorithm, algorithm representation and introduction to Integrated Development
Environment (IDE).

6.2 Basics of Algorithm


Algorithm is a step-by-step process of solving a well-defined computational problem and it is
used to simplify the program implementation. In computers, programs are developed to solve
some problems. These programs can be written using some computer programming
languages like Basic, C, C++, Java and Python.

To solve the problem using computers, we must follow the steps described below.

A. The problem must be analyzed thoroughly.


B. Solution method is broken down into a sequence of small tasks.
C. Based on this analysis, an algorithm must be prepared to solve the problem.
D. The algorithm must be expressed in precise notation.
E. In viewing algorithm, a computer program has to be designed in any high-level
language.
F. The computer program is fed into the computer.
G. The instruction in the program executes one after another and outputs the expected result

6.3 Definition of Algorithm


An algorithm is a precise method of solving a problem. It consists of a sequence of
unambiguous, step-by-step instructions.

A program is an algorithm that has been converted into program code so that it can be executed
by a computer.

 An algorithm is a set of rules for carrying out calculations either by hand or a machine. ƒ
 An algorithm is a finite step-by-step procedure to achieve a required result. ƒ
 An algorithm is a sequence of computational steps that transform the input into the
output.

1
The term algorithm means “a process or set of rules to be followed in calculations or other
problem-solving operations.”

6.4 Characteristics of Algorithm

Algorithm should be: ƒ

1. Clear and unambiguous: The algorithm should be unambiguous. Each of its steps
should be clear in all aspects and must lead to only one meaning. ƒ
2. Well-defined inputs: If an algorithm says to take inputs, they should be well-defined. ƒ
3. Well-defined outputs: The algorithm must clearly define what output will be yielded and
it should be well-defined as well. ƒ
4. Finiteness: The algorithm must be finite, i.e. it should not end up in infinite loops or
similar. ƒ
5. Feasible: The algorithm must be simple, generic and practical so that it can be executed
upon the available resources. It must not contain some future technology or anything. ƒ
2
6. Language independent: The algorithm designed must be languageindependent, i.e. it
must be just plain instructions that can be implemented in any language, and yet the
output will be the same as expected.

Advantages of algorithm ƒ

 It is easy to understand. ƒ
 Algorithm is a stepwise representation of a solution to a given problem.
 In the algorithm the problem is broken down into smaller pieces or steps; hence, it is
easier for the programmer to convert it into an actual program.

Disadvantages of algorithm ƒ

 Writing an algorithm takes a long time, so it is time-consuming. ƒ


 Branching and looping statements are difficult to show in algorithms.

Examples of algorithm

Let us consider a few examples of creating an algorithm for a given problem.

Example 1: Algorithm for the sum of two numbers ƒ

Step 1: Take the first number from the user (input). ƒ

Step 2: Take the second number from the user (input). ƒ

Step 3: Add the two numbers to get the sum (process). ƒ

Step 4: Display the sum on the screen (output).

You might also like