Lessons

What is an algorithm?

An algorithm is a finite set of instructions that are executed one after the other and in a certain order (sequentially) and perform a specific task or solve a problem.


Features of an Algorithm

1. It has a beginning and an end. (Finally, the sequence of instructions must reach an end point)

2. Its instructions are clearly stated. (It has to be run only in one way)

3. It has an output.


The Assignment Operator

The assignment operator assigns a value to a box (a variable).

We show the assignment operator with an arrow: →


Features of the Boxes

1. The boxes are initially empty.

2. A box cannot hold two values ​​at the same time.

3. If a new value is entered into the box, the previous value will be deleted.


The Algorithm for Calculating the Area of a Circle:

Step 1: Start

Step 2: Input the radius → r

Step 3: 3.14 → pi

Step 4: pi*r*r → s

Step 5: print s

Step 6: End


The Simple Version of the Algorithm

Step 1: Start

Step 2: Input the radius → r

Step 3: print 3.14*r*r

Step 4: End