ALGORITHM AND FLOW CHART

To make a computer do anything you have to write a computer program. To write a computer program you have to tell the computer, step by step exactly what you want it to do.

An Algorithm can be defined as the set of rules and sequential steps that define how a particular problem can be solved in finite and ordered sequence.

An Algorithm written in a computer is called a program. Simply speaking an Algorithm is called the heart of programing. An Algorithm describes a method by which a given task is accomplished.

A Flow Chart is the pictorial representation in which symbols are used to show the various operations and decisions to be followed in solving a problem.

FUNCTIONS OF ALGORITHMS

An Algorithm generally takes some input, carries out a number of effective steps in a finite amount of time, and produces some output

CHARACTERISTICS OF ALGORITM

1.Â Â Â Â Â Â  UNAMBIGUOUS: It should state clearly what each line of the Algorithm does

2.Â Â Â Â Â Â  DEFINITE AND EFFECTIVE:Â  This implies the successful termination of the program.

Thus every Algorithm should have the following characteristics

1.Â Â Â Â Â Â  Input

2.Â Â Â Â Â Â  Output

3.Â Â Â Â Â Â  Definiteness

4.Â Â Â Â Â Â  Effectiveness

5.Â Â Â Â Â Â  Termination

An Algorithm uses the words BEGIN start and END to end

BEGIN(start of algorithm)

Step1

Step2

Step3

â€¦â€¦â€¦â€¦.

â€¦â€¦â€¦â€¦..

Step n

END(END OF ALGORITHM)

An algorithm to print ten odd numbers

Input : the start number

Output: First ten odd numbers

STEPS:

1.Â Â Â Â Â Â  Let the first number be n

2.Â Â Â Â Â Â  n =1

3.Â Â Â Â Â Â  Print n

4.Â Â Â Â Â Â  Count c =1

5.Â Â Â Â Â Â  Add 2 to n

6.Â Â Â Â Â Â  Add 1 to c

7.Â Â Â Â Â Â  Is c > 10 : Go to step 5

8.Â Â Â Â Â Â  Stop

9.Â Â Â Â Â Â  End Â algorithm

An algorithm to print average of given sets of numbers

Input: read the value of n where n is the total numbers we have

Output: the average of numbers

STEPS:

2.Â Â Â  I =1, sum =0

3.Â Â Â  If i>n go to 9

4.Â Â Â  Read the value of X

5.Â Â Â  SUM =SUM +x

6.Â Â Â  I =I +1

7.Â Â Â  Go to 3

8.Â Â Â  Average = SUM/ n

9.Â Â Â  Print Average

10.Â Â  End

1.Â Â Â Â Â Â  List and explain stages involved in program development

2.Â Â Â Â Â Â  List examples of a compiled and interpreted program

Student are allowed to give corrections to the assessment given by the teacher ,while the teacher support s them in order to guide them