Education

Input & Output Devices

Algorithm and Flowcharts


ALGORITHM AND FLOWCHARTS

·     How to steps in development of a program :


A software is a group of program and a  program is a list of instructions , where each statement tells the computer to do the desired task . The emphasis is on the processing the algorithms needed to perform the desired computation .
The programs development process include following few stages given below :

·         Program Design :  program design is concerned  with the development of a strategy to be used in writing the program , in order to achieve the solution of a problem in program . A program design involves the following stages given below :

a.       Problem analysis
b.      Outlining of program structure
c.       Algorithm development
d.      Selection of control structures

·         Program coding :The algorithm development in the previous step must be translate into a set of instructions that a computer that a computer can understand . The major emphasis in coding should be simplicity and clarity .  The elements of coding style include are given below  :

a.       Internal documentation
b.      Construction of statements
c.       Generally of the program
d.      Input /output formats

·         Program testing :Testing and debugging refers to the tasks of detecting and removing errors in a program , so that the program produces the desired results . The various type of errors are given blow :

i.                     Syntax errors
ii.                   Run time errors
iii.                  Logical errors
iv.                 Latent errors

Testing should include necessary steps to detect all possible errors in the program .



·     What is problem solving :

Before writing a program to solve a particular problem , it is essential to have a thorough understanding  of the problem , and a carefully planned approach to solving the problem .
A programmer can’t write the instruction to be followed by a computer unless the programmer knows how to solve the problem manually . An algorithms and flowchart help to solve the errors of the program .

·     Algorithms :

An algorithm is finite sequence of instructions , each of which has a clear meaning and can be performed with a finite length of time. The solution to any computing problem includes executing a series of actions in a specific order . A procedure for solving a problem in terms of the actions to be executed and the order in which these actions are to be executed is called algorithm . The term  algorithm is often used to refer to the logical of a program . It is step by step description of how to archived the solution of the given problem .
 Algorithm may be defined as sequence of instructions designed in such a way that if the instructions are executed in the specific sequence , the desired results will be obtained . Hence in order to qualify as an algorithm , a sequence of instructions must possess the following characteristics :

1.       Each and every instruction should be precise and unambiguous .
2.       Each instruction should be such that it can be performed in a finite time .
3.       One or more instructions should not be repeated infinitely . This ensures that the algorithm will ultimately  terminate .
4.       After performing the instructions ex. After the algorithm terminates , the desired results must be obtained .

SOME EASY EXAMPLES OF AN ALGORITHMS :

1.       Sum of two no.
Step 1. Input A,B
Step 2. SUM =A+B
Step 3. Write “ Sum of two numbers ” , SUM
Step 4. END


2.       Sub of two no.
Step 1.  INPUT , B
Step 2.SUM=A-B
Step 3.Write “sub. Of two numbers ”, SUB
Step 4.END


·     FLOWCHARTS :

A Flowchart is a pictorial representation of an algorithm . It is the layout , in a visual, two dimensional format , of the corresponding algorithm is converted into a program by writing it in a programming language .
            A Flowchart is a means of visually presenting the follow of data through an information processing systems , the operators performed within the system and the sequence in which they are performed . The program flowchart can be likened to the blueprint of a building . As we know a designer draws a blueprint before starting construction on a building .Similarly , a programmer prefers to drawn a flowchart prior to writing a computer program . As in the case of the drawing of a blueprint , the flowchart is drawn according to defined rules and using standard flowchart symbols prescribed by the American National Standard Institute , Inc.

·         Symbols of Flowchart :


1.       Start / end :The terminator symbol marks the starting or ending  point of the system . it is usually contains the word “Start” or “End”.
2.       Action or Process : A box can represent a single step (add two numbers), or and entire sub-process (sum ) within a longer process .
3.       Document : A printed document or report.
4.       Decision : A decision or branching point . Lines representing different decisions emerge from different points of the diamond .
5.       Input / Output : It represent material of information entering or leaving the system , such as customers order (input) or a product (Output).
6.       Connector : It indicates that the flow continuous where a matching symbol (containing the same latter) has been placed .
7.       Flow Line : Lines indicate the sequence of steps and the direction of flow .
8.       Delay : Indicates a sequence of actions that perform a specific task embedded within a larger process . This sequence of actions could be described in more detail on a separate flowchart.
9.       Database : Indicates a list of information with a standard structure that allows for searching and sorting .
10.   Magnetic disk : Shows that data is to be input or output by magnetic disk .
11.   Magnetic tape : Shows input or output of data using magnetic tape device .

·     Types of Flowchart :
1.              Two – way branch
2.              Three –way branch
3.              Multiple –way branch

·     Advantages of using Flowcharts :

1.                   Communication : Flowchart are better way of communicating the logical of a system to all concerned . A Flowchart is a pictorial representation of a program , it is easier for programmer to explain the logic of a program to some other programmer through a flowchart rather than the program itself .
2.                   Effective analysis :with the help of flowchart , problem can be analysed In more effective way.
3.                   Proper documentation : Program flowcharts server as a good program documentation , which is needed for various purpose .
4.                   Efficient coding : The Flowcharts act as a guide or blueprint during the systems analysis and program development phase .
5.                   Proper Debugging : The flowchart helps is debugging process .
6.                   Efficient program maintenance : The maintenance of operating program becomes easy with help of flowchart . It helps the programmer to put efforts more efficiently on that part .

·     Limitation of using flowcharts :

1.       Complex logic : sometimes , the program logic is quit complicated . In that case , flowchart becomes complex and clumsy .
2.       Alternation and modifications : If alternations are required the flowchart may require re-drawing completely .
3.       Reproduction : As the flowchart symbols can’t be typed , reproduction of flowchart becomes a problem .
4.       The essentials of what is done can be lost in the technical details of how it is done.



Comments