0% found this document useful (0 votes)
204 views13 pages

Flowchart Algorithm

This document provides an introduction to algorithms and flowcharts. It defines an algorithm as a step-by-step logical procedure for solving a problem and lists common algorithm components like "start", "let", "print", and "stop". Examples of algorithms to calculate the cube of 5 and find the area of a square are given. Flowcharts are described as a diagrammatic representation of an algorithm using standard symbols like rectangles, diamonds, and arrows. Properties of algorithms and exercises to design algorithms and flowcharts for problems like finding the perimeter of a square are also included.

Uploaded by

Srija Reddy
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
Download as ppt, pdf, or txt
0% found this document useful (0 votes)
204 views13 pages

Flowchart Algorithm

This document provides an introduction to algorithms and flowcharts. It defines an algorithm as a step-by-step logical procedure for solving a problem and lists common algorithm components like "start", "let", "print", and "stop". Examples of algorithms to calculate the cube of 5 and find the area of a square are given. Flowcharts are described as a diagrammatic representation of an algorithm using standard symbols like rectangles, diamonds, and arrows. Properties of algorithms and exercises to design algorithms and flowcharts for problems like finding the perimeter of a square are also included.

Uploaded by

Srija Reddy
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1/ 13

Introduction to Computers

D. MALLIKARJUNA REDDY Department of Statistics Kakatiya University WARANGAL

Flow chart and Algorithm development


Program : A set of instructions given in a systematic order to
solve a problem. In the computer world preparation of the programs is major task. Before implementing the programs every computer programmer will follow the two methods. Those

are:
1. Algorithms 2. Flow charts

Algorithm : Algorithm is a method of representing the step-by-step

logical procedure for solving a problem. Algorithm will start with the term start and terminate with stop statement. For each and every step we provide a step number. Some basic terms implemented in an algorithm:
1. Start : The indication of this term is starting point of an algorithm. 2. Let : The purpose of this command is assigning a value or for

calculation.
3. Print : It will display the message or a value. 4. Read : To collect the value into a respective name Read is suitable. 5. Stop : The termination of the algorithm is possible with the term Stop (or) End.

1. Design an algorithm to find the cube of 5.

Step 1 : start
Step 2 : let a = 5 Step 3 : let cube = a x a x a

Step 4 : print cube


Step 5 : stop 2. Design an algorithm to calculate area of a square. Step 1 : start Step 2 : read side Step 3 : let area = s x s Step 4 : print area Step 5 : stop

3. Design an algorithm to calculate area and perimeter of a rectangle. Step 1 : start Step 2 : read l Step 3 : read b Step 4 : let area = l x b Step 5 : let per = 2 x ( l + b ) Step 6 : print area Step 7 : print per Step 8 : stop (or) Step 1 : start Step 2 : read l , b Step 3 : let area = l x b Step 4 : let per = 2 x ( l + b ) Step 5 : print area , per Step 6 : stop

Properties of an algorithm :

1. Finiteness : An algorithm must terminate in a finite number of steps.


2. Definiteness : Each step of the algorithm must be unambiguously stated. 3. Effectiveness : Each step must be effective, in the sense that it should be easily convertible into program statement and can be performed exactly in a finite amount of time. 4. Generality : The algorithm must be complete in itself so that it can be used to solve all problems of a specific type for any input data.

5. Input / Output : Each algorithm must take zero, one or more quantities
as input data and produce one or more output values.

Exercise

1. Design an algorithm to calculate perimeter of square.


2 . Design an algorithm to find sum of three numbers. 3. Design an algorithm to find average of 4 numbers. 4. Design an algorithm to calculate square of a given number.

Flow Chart :

Flow chart is diagrammatic representation of an


algorithm. It is constructed using different types of boxes and symbols. All symbols are connected by arrows among themselves to indicate, the flow of information and processing. Important points in drawing flow charts :

1. Flow chart should be clear, neat and easy to follow.


2. Flow chart should be logically correct.

3. Flow chart should be verified for its validity with some test
data.

Following are the standard symbols used in drawing flowcharts : Symbol Name Vowel Rectangle Operation Start / stop Processing

Parallelogram
Circle Rhombus Arrows

Input / Output
Used to connect different parts of flow chart (connector) Decision making or condition Flow

1. Design a flow chart to calculate cube of 5.

Start

Let c = 5

Let cube = c x c x c

Print cube

Stop

2. Find out average of n numbers.


Start Read n Count = 0 Sum = 0 Avg = 0 Read a Sum = sum + a Count = count + 1 Count < = n False Avg = sum / n True

Print avg Stop

Exercise :

1. Design a flow chart to print greatest of two numbers.


2. Design a flow chart to calculate product of three numbers. 3. Design a flow chart to print total and average of student marks in three subjects.

Draw flow charts for all algorithms taught in previous class.

Limitations of Flow charts :

1. Flow charts are difficult to modify. Re-drawing of flowchart may be necessary.


2. Translation of flowchart into computer program is always not easy. Advantages of Flow charts : 1. Logic of program is clearly represented. 2. It is easy to follow the flow chart.

THANK YOU.

Thank you for attention

You might also like