Algorithm and flowchart
The computer is a multitasking machine .It can perform various simple and complex task. These task are accomplished when proper instruction are given. The set of instruction given to a computer to complete a task is called a program. The basic necessity while writing a program is the sequence of instruction which gives the desired result .In the other word ,if the instruction given or not in the correct order ,then the computer program will not be able to complete the given task.
For writing a successful program, these are three steps which need to be followed.
1. Writing an algorithm.
2. On the basis of the algorithm designing,a flowchart.
3. Converting the flowchart into the program.
Algorithm
An algorithm is defined as the set of instruction which are used to perform a specific task or solve mathematical or logical problem. It is written in easy language and the instruction are are given in the proper sequence.Thus, an algorithm is precise and to the point.
Let us understand the importance of sequence of step with the help of following example.
To cook Maggi noodles, follow the given step:
Step: 1 start
Step: 2 take a pan
Step: 3 pour some water in it
Step: 4 put the pan on the gas stove
Step : 5 put Maggi noodles
Step: 6 add dry powder
Step:. 7 let it boil and cook
Step: 8 serve the Maggi
Step: 9 stop
1. An algorithm is a precise set of instruction.
2. The instruction of algorithm in proper order.
3. It is easy to computable.
Steps to develop an algorithm
1. define the problem in simple and effective language.
2.define the inputs and outputs clearly.
3.described the set to convert input into outputs.
4.start from the highest level and refine the stop gradually to make them effective computable operation.
5. Choose data sets to verify the working of algorithm.
Flowchart
A flowchart is a pictorial representation of the sequence of steps, to solve a problem in the form of diagrams and symbols. It can also be regarded as the pictorial representation of algorithms .The symbol used in the flowchart maintain consistency of the program.
Symbols used in flowchart
A flowchart source the flow of a program. Each operation in it is represented by drawing a specific geometric symbol. These geometric symbols of flowchart symbols are connected by flow lines. They show the sequence of operations.
Some basic symbols of a flowchart are given in the table below
Rules of a flowchart
1. Flowchart begin with start and end with stop.
2. A problem is broken down into simpler in instruction.
3. symbol are chosen according to the stage.
4. The flow of flowchart is either from top to bottom or from left to right.
5. different part of flowchart are joined by connectors.
6. A loop is used when a process is repeated again and again.
Advantages of flowchart
1. It is more convenient and easy to draw a flowchart then to write a program directly.
2. It is easier to understand.
3. It is independent of any computer programming language.
Limitations of flowchart
1. Reproduction of flowchart is difficult as symbol cannot be typed.
2. Alteration cannot be made in a flowchart. A new flow chart is created to include the changes .
3. knowledge of symbol is mandatory for drawing a flowchart.
Example: This is a flowchart to find the sum of 30 and 50
Convert an algorithm into a flowchart
Algorithm can be easily converted into flowchart . The symbol used in drawing a flowchart should be chosen appropriately.
let us understand how to convert an algorithm into a flowchart by studying the example given below
Algorithm to add 6 numbers
step 1 start .
step 2 take 6 numbers.
step 3 Add the 6 numbers.
step 4 print the result.
step 5 stop.
flowchart to add 6 number is given alongbellow.
Loop
loop is defined as the sequence of instruction by which the action is repeated for a specific time.
Answer the following questions
Question number 1 what is program?
Question number 2 how an algorithm is written?
Question number 3 what are the characteristics of algorithm?
Question number 4 define flowchart? Questionnumber 5 name any five basic symbols of flowchart?
Question number 6 write the limitation of flowchart?
Comments
Post a Comment