Flowcharts and algorithms

hemdeepbhavsar 6,997 views 12 slides May 04, 2014
Slide 1
Slide 1 of 12
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12

About This Presentation

this ppt is about flowchart and algorithm...
the contents are definition, advantages ,diadvantages etc......


Slide Content

Prepared by: Ravi bharadva 130110120 007 Hemdeep bhavsar 130110120 008 Nayan chauhan 130110120 009 Chintan kathrecha 130110120 010 Chitt kakadia 130110120 011 Yashraj chudasama 130110120 012 Faculty j.v sIR Flowcharts and algorithms

What is algorithm? An algorithm is the finite set of sequential instructions to accomplish a task where instructions are written in a simple English language. It is called as a step by step solution of the program. It is a well developed, organized approach to solving complex problems. It refers to logic of program. It is step by step solution to given program.

Characteristics of algorithm Algorithm has four characteristics: Finiteness : Total number of steps used in algorithm should be finite. Definiteness : Each step of algorithm must be clear and un ambiguous. Effectiveness : Every step must be basic and essential. Input & output : the algorithm must accept zero or more input and must produce at least one output.

How to develop an algorithm First identify different inputs to be given to system. Then identify what output you want from the program. Then create logic for it. Break that logic into simple steps. Write this steps in order. This forms the algorithm required from the given logic.

Advantages Disadvantages Very easy to write. Easy technique to understand logic. Easy identification of the mistakes by non computer person. Time consuming. Difficult to show branching and looping. Big tasks are difficult to put in algorithm.

What is a flowchart? It is a pictorial representation of the algorithm. What we did in algorithm, we can represent it in flowchart. This format is easy to understand. It shows us the flow of the instructions.

Symbols of flowchart Name Symbol Use in flowchart Oval Used at starting and at ending of the program. Flowlines Used to show direction of the flow. Parallelogram Used for input output options. Rectangle Denotes process to be carried out. Start Stop

round Diamond It is used for showing decision structure. Round Connecting flow lines from different places Block Indicates block of statements or body of loop Symbols of flowchart

Advantages Disadvantages Easy to draw. Easy technique to understand logic. Easy to identify the mistake by non computer person. Easy for branching and looping. Time consuming. Difficult for modification. Difficult task to draw flow charts for big programs.

Different operators used in programing Determine how one value relates to another Equal to == Not equal to != Less than < Greater than > Less than or Equal to <= Greater than or Equal to >=

Example 1: write an algorithm and flowchart for converting length in feet to centimeter. Algorithm: Step1: input l in ft Step 2: L in cm= l in ft*30 Step 3: Print l in cm. Flowchart: in ft L in cm= l in ft*3 start Read value of l L in cm= l in ft*30 Print l in cm stop

Example2: write an algorithm and flowchart to read 2 sides of rectangle and calc. its area. Algorithm: Step1: read input W,L. Step2: A=W*L Step3: print A Flowchart: Read W,L A=L*W Print A start Read value of W & L A= L*W; A = L * W Print area A stop
Tags