0% found this document useful (0 votes)
0 views

Algorithm and flowchart

The document explains algorithms as step-by-step procedures for problem-solving, emphasizing their properties and advantages, such as reduced complexity and increased flexibility. It also introduces flowcharts as graphical representations of algorithms, detailing their uses, symbols, and guidelines for drawing them. Additionally, it addresses limitations of flowcharts, including challenges in complexity and the need for redesign when changes occur.

Uploaded by

aslamsaira437
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

Algorithm and flowchart

The document explains algorithms as step-by-step procedures for problem-solving, emphasizing their properties and advantages, such as reduced complexity and increased flexibility. It also introduces flowcharts as graphical representations of algorithms, detailing their uses, symbols, and guidelines for drawing them. Additionally, it addresses limitations of flowcharts, including challenges in complexity and the need for redesign when changes occur.

Uploaded by

aslamsaira437
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Title:

Flowcharts And Algorithms


Algorithm:
An algorithm is a step-by-step procedure to solve a problem. The process of solving a
problem becomes simpler and easier with the help of an algorithm. It is better to write an
algorithm before writing the actual computer program.

Properties Of Algorithm
Different properties of an algorithm are as follows:
The given problem should be broken down into simple and meaningful steps.
The steps should be numbered sequentially.
The steps should be descriptive and written in simple English.
Algorithms are written in a language that is similar to simple English called pseudo
Code. There is no standard to write pseud code. It is used to specify program logic in an English
like manner that is independent of any particular programming language.
Pseudo code simplifiers program development by separating it into two main parts.
1. Logical Design In this part, the logic of the program is designed. We specify different
steps required to solve the problem and sequence of these steps.
2. In this part, the algorithms is converted into a program. The steps of the algorithm are
translated into instructions of any programming language.
The use of pseudo code allows the programmer to focus on the planning of program. After the
planning is final, it can be written in any programming language.
Example :
The following algorithm inputs two numbers, calculates sum and then displays the result
on screen.
1. Start
2. Input A
3. Input B
4. Total =A+B
5. Display Total
6. Exit
Advantages of Algorithm
Some of advantages are as follows;

1 .Reduced Complexity
Writing algorithm and program separately simplifies the overall task by dividing it into
two simpler tasks. While writing the algorithm, we can focus on solving the problem instead of
concentrating on a particular language.

2.Increased Flexibility
Algorithm is written so that the code may be written in any language. Using the
algorithm, the program could be written in visual Basic ,Java or C++ etc.

3. Ease of Understanding
It is not necessary to understand a particular programming language to understand an
algorithm. It is written in an English like manner.

Flowcharts:
Flowchart is a combination of two words flow and chart. A chart consists of different symbols to
display information about any program. Flow indicates the direction of processing that takes
place in the program.
Flowchart is a graphical representation of an algorithm. It is a way of visually presenting
the flow of data, operations performed on data and sequence of these operations. Flowchart is
similar to the layout plan of a building. A designer draws the layout plan of the building before
constructing it. Similarly , a programmer prefer to design the flowchart before writing the
computer program. Flowchart is designed according to the defined rules.

Uses of Flowchart
Flowchart is used fot the following reasons.
1. Flowchart is used to improve the logic for solving a problem.
2. Flowchart is used to show represent an algorithm in simple graphical manner.
3. Flowchart is used to show the steps of an algorithm in any easy way.
4. Flowchart is used to understand the flow of the program.
5. Programs can be reviewed and debugged easily.
Flowchart Symbols
The standard symbol are used to draw a flowchart. The commonly use standard
symbols to draw flowcharts are a follows:
1. Start / Terminal
Oval is used to represent the start or end of the flowchart. It is also called
terminal.

Example
The following example displays the start and end steps in the flowcharts.

Start End
2. Input / Output
Parallelogram is used to represent an input or output step in the flowchart.

Example
The following example displays the inputs and output steps in the
flowchart .

Input Marks Display Marks


3. Process
Rectangle is used to represent a
processing or computational operation in the flowchart.

Example
The following example display the processing step in the flowchart.
Sum = A +B

4. Flow Lines
Arrows are used to represent the direction of flow in the flowchart. There are four
flow lines to represent four directions.

5. Decision
Diamond symbol is used to represent decision step in the flowchart. A condition is
given in the diamond. The flow of control from diamond symbol may go in two
possible directions. It goes to one direction if the condition is TRUE or YES and to
second direction if the condition is FALSE or NO .

6. Connector
Circle symbol is used to combine different flow lines. It is used when two or more
flow symbols come from different direction and move to one direction.

7. Functional call
Rectangular symbol with the double line on left and rights sides is used to
call a function . The name of a function with parentheses is written inside
the symbol.

8. Preparation
This symbol is used with for loops to specify start and stop condition.
Guidelines for Drawing Flowchart
Different guidelines for drawing a flowchart are as follows:

1. All necessary requirements should be listed in a logical order while drawing a flowchart.
2. Flowchart should be clear, neat and easy to follow.
3. The flow of flowchart can be from left to right or top to bottom.

4. Only one flow line should enter and come out of the process symbol.
5. Only one flow line can enter a decision symbol. However, two flow lines can be out of
it.

6. Only one flow line can be used in Start and End symbols.
7. The intersection of flow lines should be avoided.
8. The comments should be written in remarks symbol.
9. The connector should be used to reduce the number of flow lines if the flowchart
become complex.
10. It is useful to ensure the validity of flowchart by testing it with sample data .

Limitations of Flowchart
The limitation of flowchart are as follows;

1. It is difficult to draw flowcharts for complex problems.


2. The flowchart has to be redesigned if any change is required.
Example 1
The following flowchart finds the total of two numbers.

Start

Input a, b

Sum = a+ b

Print sum

End

You might also like