You are on page 1of 5

Representation of Algorithms

Using their algorithmic thinking skills, the software designers or programmers analyse the problem
and identify the logical steps that need to be followed to reach a solution. Once the steps are identified,
the need is to write down these steps along with the required input and desired output. There are two
common methods of representing an algorithm —flowchart and pseudocode.
FLOW CHART:

A Flow chart is a Graphical representation of an Algorithm. Flow charts are drawn using
certain special purpose symbols such as Rectangles, Diamonds, Ovals and small circles. These
symbols are connected by arrows called flow lines.
(or)
The diagrammatic representation of way to solve the given problem is called flow chart.

Symbol Symbol Name Usage Usage Description


Used to represent Start or
Oval Terminal
Stop/end of algorithm
Used to represent
Rectangle Process processing data or
assignment
Used to represent input or
Parallelogram Data
output data

Used to represent selection


Diamond Decision
or Conditional statement
Used to represent the
Circle Connector joining of more than one
flow into one
Used to represent flow of
Arrow Flow execution by joining
symbols

Uses of flow charts: The following are the basic uses of flow charts.

 Defining and analyzing processes.


 Building a step-by-step picture of the process for analysis, discussion, or communication
purposes.
 Defining, standardizing, or finding areas for improvement in a process.

.
Pseudocode
A pseudocode (pronounced Soo-doh-kohd) is another way of representing an algorithm. It is
considered as a non-formal language that helps programmers to write algorithm. It is a detailed
description of instructions that a computer must follow in a particular order. It is intended for human
reading and cannot be executed directly by the computer. No specific standard for writing a
pseudocode exists. The word “pseudo” means “not real,” so “pseudocode” means “not real code”.
Following are some of the frequently used keywords while writing pseudocode:

• INPUT

• COMPUTE

• PRINT

• INCREMENT

• DECREMENT

• IF/ELSE

• WHILE

• TRUE/FALSE

Write an algorithm to display the sum of two numbers entered by user, using both pseudocode and
flowchart.

Pseudocode for the sum of two numbers will be:

input num1

input num2

COMPUTE Result = num1 + num2

PRINT Result
Program development steps:

Program development contains following steps:

i). Creating the program

ii). Compiling the program

iii).Linking the program

iv).Executing the program

i) Creating the program:

In this step, the program can be written into a file through text editor. The file is saved on the disk with
and extension. Corrections to the program at later stages are done to these editors. Once the program
has written, it requires to be translated into machine language.

ii) Compiling the program:

The code in a source file must be translated into machine language. This is the job of the
compiler. The c compiler is two separate programs-preprocessor and the translator.

The preprocessor reads the source code by scanning preprocessor commands and replacing
with special code libraries by finally preparing it for the translator.

After the preprocessor has prepared the code for compilation, the translator does the actual
work of converting the program into machine language.
iii) Linking the program:

The linker links all the files and functions with the object code under execution.

Ex: printf-the linker links the user programs object with the object of the printf

function. Now object code is ready for next phase.

iv) Execution the program:

The execution object code is loaded into the memory and the program execution begins. It encounters
error to till the execution phase, Even though compilation phase is successful. These errors may be
logical errors.

PROGRAM DEVELOPMENT STEPS:


Program Development is a multistep process that requires that we understand the problem,
develop a solution, write the program, and then test it. This is known as program design.
Understand the Problem
The first step in solving any problem is to understand it. By reading the requirements
statements carefully, we fully understand it; we review our understanding with the user and the
systems analyst to know the exact purpose.

Develop the solution


Once we fully understand the problem we need to develop our solution. Three tools will help in
this task. 1. Structure chart, 2.Psuedocode &3.Flowcharts. Generally we will use structure chart and
either flowchart or Pseudo code

The structure chart is used to design the whole program .


Pseudo code and flowcharts are used to design the individual parts of the program.
Structure chart: A structure chart, also known as hierarchy chart, shows the functional flow through
our program. The structure chart shows how we are going to break our program into logical steps each
step will be a separate module.

We can use flowchart or pseudo code to complete the design of your program.

You might also like