SlideShare ist ein Scribd-Unternehmen logo
1 von 68
CHAPTER 06
ALGORITHMS AND FLOW CHARTS
Unit 1:
XI
Computer Science (083)
Board : CBSE
• Computer Systems and Organisation
(CSO)
Unit 1:
XI
Computer Science (083)
Board : CBSE
Courtesy CBSE
Computer Systems and Organisation (CSO)
Unit I
10 Theory + 02 Practical)
Praveen M Jigajinni
Prepared by
Courtesy CBSE
Computer Systems and Organisation (CSO)
DCSc & Engg, PGDCA,ADCA,MCA.MSc(IT),Mtech(IT),MPhil (Comp. Sci)
Department of Computer Science, Sainik School Amaravathinagar
Cell No: 9431453730
PROBLEM SOLVING TECHNIQUES
 able to define problem;
 able to define algorithm;
 write algorithms for simple problems;
 explain properties of an algorithm;
 the meaning of flowchart;
 explain the need of flow chart;
 explain different symbols used in flow chart;
 draw flow chart for simple problems; and
convert a flow chart into an algorithm and
vice versa.
ALGORITHM AND FLOW CHART
OBJECTIVES
ALGORITHM AND FLOW CHART
Intelligence is one of the key
characteristics which differentiate a human
being from other living creatures on the
earth. Basic intelligence covers day to day
problem solving and making strategies to
handle different situations which keep
arising in day to day life.
INTRODUCTION
ALGORITHM AND FLOW CHART
One person goes Bank to withdraw money.
After knowing the balance in his account,
he/she decides to withdraw the entire
amount from his account but he/she has to
leave minimum balance in his account.
INTRODUCTION
ALGORITHM AND FLOW CHART
Here deciding about how much amount
he/she may withdraw from the account is
one of the example of the basic
intelligence. During the process of solving
any problem, one tries to find the
necessary steps to be taken in a sequence.
INTRODUCTION
ALGORITHM AND FLOW CHART
What is Algorithm?
Algorithm can be defined as: “A sequ
ence of activities to be processed for getti
ng desired output from a given input.”
ALGORITHM AND FLOW CHART
What is Algorithm?
Webopedia defines an algorithm as:
“A formula or set of steps for solving a
particularproblem. To be an algorithm, a set
of rules must be unambiguous and have a cl
ear stopping point”.
MUHAMMAD IBN MUSA AL-KHWARIZMI
Muḥammad ibn Mūsā al-
Khwārizmī (Persian: ‫محمد‬‫بن‬‫موسى‬
‫;خوارزمی‬ c. 780 – c. 850),
Formerly Latinized as Algoritmi, was
a Persian scholar who produced
works in mathematics, astronomy,
& geography under the patronage
of the Caliph Al-Ma'mun of
the Abbasid Caliphate.
Around 820 AD he was appointed as the astronomer
and head of the library of the House of
Wisdom in Baghdad.
PROPERTIES OF ALGORITHM
Donald Ervin Knuth has given a list of five
properties for an algorithm, these
properties are:
1) FINITENESS
2) DEFINITENESS
3) INPUT
4) OUTPUT
5) EFFECTIVENESS
PROPERTIES OF ALGORITHM
1) FINITENESS:
An algorithm must always terminate
after a finite number of steps. It
means after every step one reach
closer to solution of the problem and
after a finite number of steps
algorithm reaches to an end point.
PROPERTIES OF ALGORITHM
2) DEFINITENESS
Each step of an algorithm must be
precisely defined. It is done by well
thought actions to be performed at
each step of the algorithm. Also the
actions are defined unambiguously for
each activity in the algorithm.
PROPERTIES OF ALGORITHM
3) INPUT
Any operation you perform need
some beginning value/quantities
associated with different activities in
the operation. So the value/quantities
are given to the algorithm before it
begins.
PROPERTIES OF ALGORITHM
4) OUTPUT:
One always expects output/result
(expected value/quantities) in terms of output
from an algorithm. The result may be obtained
at different stages of the algorithm. If some
result is from the intermediate stage of the
operation then it is known as intermediate
result and result obtained at the end of
algorithm is known as end result. The output
is expected value/quantities always have a
specified relation to the inputs.
PROPERTIES OF ALGORITHM
5) EFFECTIVENESS:
Algorithms to be developed/written
using basic operations. Actually operations
should be basic, so that even they can in
principle be done exactly and in a finite
amount of time by a person, by using paper
and pencil only.
PROPERTIES OF ALGORITHM
Any algorithm should have all these five
properties otherwise it will not fulfil the
basic objective of solving a problem in finite
time. As you have seen in previous
examples, every step of an algorithm puts
you closer to the solution
ADVANTAGES OF ALGORITHM
The use of algorithms provides a number of
advantages. One of these advantages is in
the development of the procedure itself,
which involves identification of the
processes, major decision points, and
variables necessary to solve the problem.
Developing an algorithm allows and even
forces examination of the solution process
in a rational manner.
ADVANTAGES OF ALGORITHM
Identification of the processes and decision
points reduces the task into a series of
smaller steps of more manageable size.
Problems that would be difficult or
impossible to solve wholesale can be
approached as a series of small, solvable
sub problems. The required specification
aids in the identification and reduction of
subconscious biases. By using an algorithm,
decision-making becomes a more rational
process.
ADVANTAGES OF ALGORITHM
In additional to making the process more
rational, use of an algorithm will make the
process more efficient and more consistent.
Efficiency is an inherent result of the
analysis and specification process.
Consistency comes from both the use of the
same specified process and increased skill in
applying the process. An algorithm serves
as a mnemonic device and helps ensure
that variables or parts of the problem are
not ignored.
ADVANTAGES OF ALGORITHM
Presenting the solution process as an
algorithm allows more precise
communication. Finally, separation of the
procedure steps facilitates division of labor
and development of expertise.
A final benefit of the use of an algorithm
comes from the improvement it makes
possible. If the problem solver does not
know what was done, he or she will not
know what was done wrong.
ADVANTAGES OF ALGORITHM
As time goes by and results are compared
with goals, the existence of a specified
solution process allows identification of
weaknesses and errors in the process.
Reduction of a task to a specified set of
steps or algorithm is an important part of
analysis, control, and evaluation.
DISADVANTAGES OF ALGORITHM
One disadvantage of algorithms is that they
always terminate, which means there are
some computational procedures—occasionally
even useful ones—which are not algorithms.
Furthermore, all computational procedures,
whether they terminate or not, can only give
computable results, so you cannot, for
example, design a program which determines a
busy beaver number more quickly than could
be done by actually running the associated
types of Turing machines.
ALGORITHM EXAMPLES
Let us take one simple day-to-day example
by writing algorithm for making, “Maggi
Noodles‟ as a food.
Step 1: Start
Step 2: Take pan with water
Step 3: Put pan on the burner
Step 4: Switch on the gas/burner
Step 5: Put magi and masala
Step 6: Give two minutes to boil
Step 7: Take off the pan
Step 8: Take out the magi with the help of
fork/spoon
Step 9: Put the maggi on the plate and serve it
Step 10: Stop.
ALGORITHM EXAMPLES
Write an algorithm to print “Good Morning‟
Step 1: Start
Step 2: Print “Good Morning‟
Step 3: Stop
ALGORITHM EXAMPLES
Write an algorithm to find area of a rectangle.
Step 1: Start
Step 2: Take length and breadth and
store them as L and B?
Step 3: Multiply by L and B and store it
in area
Step 4: Print area
Step 5: Stop
ALGORITHM EXAMPLES
Write an algorithm to check whether he is
eligible to vote? (more than or equal to 18
years old).
Step 1: Start
Step 2: Take age and store it in age
Step 3: Check age value, if age >= 18 then go
to step 4 else step 5
Step 4: Print “Eligible to vote” and go to
step 6
Step 5: Print “Not eligible to vote”
Step 6: Stop
ALGORITHM EXAMPLES
Write an algorithm to check whether given
number is +ve, -ve or zero.
Step 1: Start
Step 2: Take any number and store it in n.
Step 3: Check n value, if n > 0 then go to
step 5 else go to step 4
Step 4: Check n value, if n < 0 then go to
step 6 else go to step 7
ALGORITHM EXAMPLES
Write an algorithm to check whether given
number is +ve, -ve or zero.
Step 5: Print “Given number is +ve”and go
to step 8
Step 6: Print “Given number is -ve” and go
to step 8
Step 7: Print “Given number is zero”
Step 8: Stop
FLOWCHART
The flowchart is a diagram which visually pre
sents the flow of data through processing
systems. This means by seeing a flow chart o
ne can know the operations performed and
the sequence of these operations in a syste
m. Algorithms are nothing but sequence of
steps for solving problems. So a flow chart ca
n be used for representing an algorithm. A
flowchart, will describe the operations
(and in what sequence) are required
to solve a given problem.
FLOWCHART
A flowchart is a type of diagram that
represents an algorithm, workflow or
process. The flowchart shows the steps as
boxes of various kinds, and their order by
connecting the boxes with arrows. This
diagrammatic representation illustrates a
solution model to a given problem.
Flowcharts are used in analyzing, designing,
documenting or managing a process or
program in various fields.
FLOWCHART
BUILDING BLOCKS
OF
FLOW CHART
OR
COMMON SYMBOLS
OF
FLOW CHART
The American National Standards
Institute (ANSI) set standards for flowcharts
and their symbols in the
1960s. The International Organization for
Standardization(ISO) adopted the ANSI
symbols in 1970. The current standard was
revised in 1985. Generally, flowcharts flow
from top to bottom and left to right.
BUILDING BLOCKS OF FLOW CHART
BUILDING BLOCKS OF FLOW CHART
ANSI/ISO
Shape
Name Description
Flowline
(Arrowhead)
Shows the process's order of
operation. A line coming from
one symbol and pointing at
another. Arrowheads are
added if the flow is not the
standard top-to-bottom, left-
to right.
BUILDING BLOCKS OF FLOW CHART
ANSI/ISO
Shape
Name Description
Terminal
Indicates the beginning and ending
of a program or sub-process.
Represented as a stadium, oval or
rounded (fillet) rectangle. They
usually contain the word "Start" or
"End", or another phrase signaling
the start or end of a process, such as
"submit inquiry" or "receive
product".
BUILDING BLOCKS OF FLOW CHART
ANSI/ISO
Shape
Name Description
Process
Represents a set of operations that
changes value, form, or location of
data. Represented as a rectangle
BUILDING BLOCKS OF FLOW CHART
ANSI/ISO
Shape
Name Description
Decision
Shows a conditional operation that
determines which one of the two
paths the program will take. The
operation is commonly a yes/no
question or true/false test.
Represented as a diamond
(rhombus).
BUILDING BLOCKS OF FLOW CHART
ANSI/ISO
Shape
Name Description
Input /
Output
Indicates the process of inputting
and outputting data, as in entering
data or displaying results.
Represented as a parallelogram
BUILDING BLOCKS OF FLOW CHART
ANSI/ISO
Shape
Name Description
Annotation
(Comment)
Indicating additional
information about a step the
program. Represented as an
open rectangle with a dashed
or solid line connecting it to
the corresponding symbol in
the flowchart.
BUILDING BLOCKS OF FLOW CHART
ANSI/ISO
Shape
Name Description
Predefined
Process
Functions
Shows named process
/Function which is defined
elsewhere. Represented as
a rectangle with double-
struck vertical edges.
BUILDING BLOCKS OF FLOW CHART
ANSI/ISO
Shape
Name Description
On-page
Connector
Pairs of labelled connectors
replace long or confusing
lines on a flowchart page.
Represented by a small
circle with a letter inside.
BUILDING BLOCKS OF FLOW CHART
ANSI/ISO
Shape
Name Description
Off-page
Connector
A labelled connector for
use when the target is on
another page. Represented
as a home plate-
shaped pentagon.
BUILDING BLOCKS OF FLOW CHART
ANSI/ISO
Shape
Name Description
Storage/
Backup
Magnetic Tape used for sec
ondary storage/Backup
BUILDING BLOCKS OF FLOW CHART
ANSI/ISO
Shape
Name Description
Storage/
Backup
Magnetic Disk used for sec
ondary storage/Backup
ADVANTAGES OF USING FLOWCHARTS
As we discussed flow chart is used for
representing algorithm in pictorial form.
This pictorial representation of a
solution/system is having many
advantages. These advantages are as
follows:
1. COMMUNICATION.
2. EFFECTIVE ANALYSIS.
3. DOCUMENTATION OF PROGRAM/SYSTEM.
4. EFFICIENT PROGRAM MAINTENANCE.
5. CODING OF THE PROGRAM.
ADVANTAGES OF USING FLOWCHARTS
1. COMMUNICATION:
A Flowchart can be used as a better way of
communication of the logic of a system and
steps involve in the solution, to all concerned
particularly to the client of system.
ADVANTAGES OF USING FLOWCHARTS
2. EFFECTIVE ANALYSIS:
A flowchart of a problem can be used for
effective analysis of the problem.
ADVANTAGES OF USING FLOWCHARTS
3.DOCUMENTATION OF PROGRAM/
SYSTEM:
Program flowcharts are a vital part of a good
program documentation. Program document is
used for various purposes like knowing the
components in the program, complexity of the
program etc.
ADVANTAGES OF USING FLOWCHARTS
4. EFFICIENT PROGRAM
MAINTENANCE:
Once a program is developed and becomes
operational it needs time to time maintenance.
With help of flowchart maintenance become
easier.
ADVANTAGES OF USING FLOWCHARTS
5. CODING OF THE PROGRAM:
Any design of solution of a problem is finally
converted into computer program. Writing code
referring the flowchart of the solution become
easy.
LIMITATIONS OF USING FLOWCHARTS
1) COMPLEXITY OF LOGIC: If program logic is
complex then flowchart of the program
becomes complicated.
2) ALTERATIONS AND MODIFICATIONS IN LOGIC:
any alterations in the program logic may require
redrawing of flowchart completely.
3) REUSE IS NOT POSSIBLE: As the flowchart
symbols cannot be typed, always reproduction
of flowchart symbols are required.
FLOWCHART EXAMPLES
Draw a flowchart to find the simple interest.
(Sequence)
FLOWCHART EXAMPLES
Draw a flowchart to find bigger number
among two numbers (selective)
FLOWCHART EXAMPLES
Draw a flow chart to find factorial of any
number.
FLOWCHART EXAMPLES
FLOWCHART EXAMPLES
Draw a flow chart to print the number from 1
to N.
FLOWCHART EXAMPLES
FLOWCHART EXAMPLES
Draw a flow chart to find biggest number
among N numbers.
FLOWCHART EXAMPLES
CLASS TEST
1. A step by step method for solving a problem
using English Language
(a) program (b) Flowchart
(c) statement (d) Algorithm
2. Set of statements is executed based upon
conditional test.
(a) Looping (b) Selective
(c) Sequence (d) None
MULTIPLE CHOICE QUESTIONS
Time: 40 Min Max Marks 20
3. Set of statements is executed again and again
based upon conditional test.
(a) Looping (b) Selective
(c) Sequence (d) None
4. The graphical representation of algorithm is
(a) program (b) Flowchart
(c) statement (d) Algorithm
5. All instructions are executed one after other.
(a) Looping (b) Selective
(c) Sequence (d) None
MULTIPLE CHOICE QUESTIONS
1. Define Algorithm.
2. Define Flowchart.
3. Write an algorithm to find the sum of two
numbers.
4. Write an algorithm to find the area of a
triangle.
5. Write an algorithm to find whether given
number is odd or even.
ANSWER THE FOLLOWING QUESTIONS.
6. Write an algorithm to find the sum of all even
number up to given number.
7. Draw a flowchart to find the area of a circle.
9. Draw a flowchart to find the smallest number
among n numbers.
ANSWER THE FOLLOWING QUESTIONS.
10. Draw a flowchart to find the sum of all
multiples of 5 up to given number.
11. Mona is confused about finite loop and
infinite loop, explain her with the help of
example.
12. Write an algorithm and a flowchart to find
sum of n numbers.
ANSWER THE FOLLOWING QUESTIONS.
THANK YOU

Weitere ähnliche Inhalte

Was ist angesagt?

Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchartSachin Goyani
 
Introduction to flowchart
Introduction to flowchartIntroduction to flowchart
Introduction to flowchartJordan Delacruz
 
Algorithm and flowchart
Algorithm and flowchart Algorithm and flowchart
Algorithm and flowchart Shivam Sharma
 
Algorithm and Flowcharts
Algorithm and FlowchartsAlgorithm and Flowcharts
Algorithm and FlowchartsSURBHI SAROHA
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchartRabin BK
 
Algorithms and Flowcharts
Algorithms and FlowchartsAlgorithms and Flowcharts
Algorithms and FlowchartsDeva Singh
 
Algorithms and flowcharts
Algorithms and flowchartsAlgorithms and flowcharts
Algorithms and flowchartsSajib
 
Flowchart and algorithm
Flowchart and algorithmFlowchart and algorithm
Flowchart and algorithmDHANIK VIKRANT
 
pseudocode and Flowchart
pseudocode and Flowchartpseudocode and Flowchart
pseudocode and FlowchartALI RAZA
 
Algorithm Design & Implementation
Algorithm Design & ImplementationAlgorithm Design & Implementation
Algorithm Design & ImplementationGaditek
 
Flowchart and algorithem
Flowchart and algorithemFlowchart and algorithem
Flowchart and algorithemehsanullah786
 
Introduction to Basic Computer Concepts Presentation
Introduction to Basic Computer Concepts PresentationIntroduction to Basic Computer Concepts Presentation
Introduction to Basic Computer Concepts PresentationAna Tan
 
Algorithm and pseudo codes
Algorithm and pseudo codesAlgorithm and pseudo codes
Algorithm and pseudo codeshermiraguilar
 
Flowchart symbols meaning explained
Flowchart symbols meaning explainedFlowchart symbols meaning explained
Flowchart symbols meaning explainedEliza Wright
 
Basic Computer Programming
Basic Computer ProgrammingBasic Computer Programming
Basic Computer ProgrammingAllen de Castro
 

Was ist angesagt? (20)

Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchart
 
Introduction to flowchart
Introduction to flowchartIntroduction to flowchart
Introduction to flowchart
 
3 algorithm-and-flowchart
3 algorithm-and-flowchart3 algorithm-and-flowchart
3 algorithm-and-flowchart
 
Lecture 4
Lecture 4Lecture 4
Lecture 4
 
Algorithm and flowchart
Algorithm and flowchart Algorithm and flowchart
Algorithm and flowchart
 
Algorithm and Flowcharts
Algorithm and FlowchartsAlgorithm and Flowcharts
Algorithm and Flowcharts
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchart
 
Algorithms and Flowcharts
Algorithms and FlowchartsAlgorithms and Flowcharts
Algorithms and Flowcharts
 
Algorithms and flow chart
Algorithms and flow chartAlgorithms and flow chart
Algorithms and flow chart
 
Algorithms and flowcharts
Algorithms and flowchartsAlgorithms and flowcharts
Algorithms and flowcharts
 
Programming
ProgrammingProgramming
Programming
 
Flowchart and algorithm
Flowchart and algorithmFlowchart and algorithm
Flowchart and algorithm
 
pseudocode and Flowchart
pseudocode and Flowchartpseudocode and Flowchart
pseudocode and Flowchart
 
Algorithm Design & Implementation
Algorithm Design & ImplementationAlgorithm Design & Implementation
Algorithm Design & Implementation
 
Flowcharts
FlowchartsFlowcharts
Flowcharts
 
Flowchart and algorithem
Flowchart and algorithemFlowchart and algorithem
Flowchart and algorithem
 
Introduction to Basic Computer Concepts Presentation
Introduction to Basic Computer Concepts PresentationIntroduction to Basic Computer Concepts Presentation
Introduction to Basic Computer Concepts Presentation
 
Algorithm and pseudo codes
Algorithm and pseudo codesAlgorithm and pseudo codes
Algorithm and pseudo codes
 
Flowchart symbols meaning explained
Flowchart symbols meaning explainedFlowchart symbols meaning explained
Flowchart symbols meaning explained
 
Basic Computer Programming
Basic Computer ProgrammingBasic Computer Programming
Basic Computer Programming
 

Ähnlich wie Chapter 6 algorithms and flow charts

11 Unit 1 Problem Solving Techniques
11  Unit 1 Problem Solving Techniques11  Unit 1 Problem Solving Techniques
11 Unit 1 Problem Solving TechniquesPraveen M Jigajinni
 
Flow Chajhbhvhhhhhhhhhhhhhrts FOR BPE.pptx
Flow Chajhbhvhhhhhhhhhhhhhrts  FOR BPE.pptxFlow Chajhbhvhhhhhhhhhhhhhrts  FOR BPE.pptx
Flow Chajhbhvhhhhhhhhhhhhhrts FOR BPE.pptxdevelvin404
 
Algorithm for computational problematic sit
Algorithm for computational problematic sitAlgorithm for computational problematic sit
Algorithm for computational problematic sitSaurabh846965
 
AOA Week 01.ppt
AOA Week 01.pptAOA Week 01.ppt
AOA Week 01.pptINAM352782
 
Design and Analysis Algorithms.pdf
Design and Analysis Algorithms.pdfDesign and Analysis Algorithms.pdf
Design and Analysis Algorithms.pdfHarshNagda5
 
Problem-solving and design 1.pptx
Problem-solving and design 1.pptxProblem-solving and design 1.pptx
Problem-solving and design 1.pptxTadiwaMawere
 
Algorithm Analysis.pdf
Algorithm Analysis.pdfAlgorithm Analysis.pdf
Algorithm Analysis.pdfNayanChandak1
 
Basics of Algorithm Unit 1 part 1 algorithm
Basics of Algorithm Unit 1 part 1  algorithmBasics of Algorithm Unit 1 part 1  algorithm
Basics of Algorithm Unit 1 part 1 algorithmJIMS LAJPAT NAGAR
 
1.1 the introduction of design and analysis of algorithm
1.1 the introduction of design and analysis of algorithm1.1 the introduction of design and analysis of algorithm
1.1 the introduction of design and analysis of algorithmMohammed khaja Jamaluddin
 
Logic Development and Algorithm.
Logic Development and Algorithm.Logic Development and Algorithm.
Logic Development and Algorithm.NandiniSidana
 
Software develop....
Software develop.... Software develop....
Software develop.... GCWUS
 
Unit 1 python (2021 r)
Unit 1 python (2021 r)Unit 1 python (2021 r)
Unit 1 python (2021 r)praveena p
 
GE3151 PSPP _Unit 1 notes and Question bank.pdf
GE3151 PSPP _Unit 1 notes and Question bank.pdfGE3151 PSPP _Unit 1 notes and Question bank.pdf
GE3151 PSPP _Unit 1 notes and Question bank.pdfAsst.prof M.Gokilavani
 
What is algorithm
What is algorithmWhat is algorithm
What is algorithmlilyMalar1
 

Ähnlich wie Chapter 6 algorithms and flow charts (20)

11 Unit 1 Problem Solving Techniques
11  Unit 1 Problem Solving Techniques11  Unit 1 Problem Solving Techniques
11 Unit 1 Problem Solving Techniques
 
Algo and flowchart
Algo and flowchartAlgo and flowchart
Algo and flowchart
 
Flow Chajhbhvhhhhhhhhhhhhhrts FOR BPE.pptx
Flow Chajhbhvhhhhhhhhhhhhhrts  FOR BPE.pptxFlow Chajhbhvhhhhhhhhhhhhhrts  FOR BPE.pptx
Flow Chajhbhvhhhhhhhhhhhhhrts FOR BPE.pptx
 
Lect 3-4 Zaheer Abbas
Lect 3-4 Zaheer AbbasLect 3-4 Zaheer Abbas
Lect 3-4 Zaheer Abbas
 
Algorithm for computational problematic sit
Algorithm for computational problematic sitAlgorithm for computational problematic sit
Algorithm for computational problematic sit
 
AOA Week 01.ppt
AOA Week 01.pptAOA Week 01.ppt
AOA Week 01.ppt
 
Design and Analysis Algorithms.pdf
Design and Analysis Algorithms.pdfDesign and Analysis Algorithms.pdf
Design and Analysis Algorithms.pdf
 
Problem-solving and design 1.pptx
Problem-solving and design 1.pptxProblem-solving and design 1.pptx
Problem-solving and design 1.pptx
 
Algorithm Analysis.pdf
Algorithm Analysis.pdfAlgorithm Analysis.pdf
Algorithm Analysis.pdf
 
Basics of Algorithm Unit 1 part 1 algorithm
Basics of Algorithm Unit 1 part 1  algorithmBasics of Algorithm Unit 1 part 1  algorithm
Basics of Algorithm Unit 1 part 1 algorithm
 
Chap6
Chap6Chap6
Chap6
 
1.1 the introduction of design and analysis of algorithm
1.1 the introduction of design and analysis of algorithm1.1 the introduction of design and analysis of algorithm
1.1 the introduction of design and analysis of algorithm
 
UNIT 1.pptx
UNIT 1.pptxUNIT 1.pptx
UNIT 1.pptx
 
Logic Development and Algorithm.
Logic Development and Algorithm.Logic Development and Algorithm.
Logic Development and Algorithm.
 
Software develop....
Software develop.... Software develop....
Software develop....
 
Unit 1 python (2021 r)
Unit 1 python (2021 r)Unit 1 python (2021 r)
Unit 1 python (2021 r)
 
GE3151 PSPP _Unit 1 notes and Question bank.pdf
GE3151 PSPP _Unit 1 notes and Question bank.pdfGE3151 PSPP _Unit 1 notes and Question bank.pdf
GE3151 PSPP _Unit 1 notes and Question bank.pdf
 
Fundamentals of Programming Chapter 3
Fundamentals of Programming Chapter 3Fundamentals of Programming Chapter 3
Fundamentals of Programming Chapter 3
 
What is algorithm
What is algorithmWhat is algorithm
What is algorithm
 
Module 1 python.pptx
Module 1 python.pptxModule 1 python.pptx
Module 1 python.pptx
 

Mehr von Praveen M Jigajinni

Chapter 09 design and analysis of algorithms
Chapter 09  design and analysis of algorithmsChapter 09  design and analysis of algorithms
Chapter 09 design and analysis of algorithmsPraveen M Jigajinni
 
Chapter 06 constructors and destructors
Chapter 06 constructors and destructorsChapter 06 constructors and destructors
Chapter 06 constructors and destructorsPraveen M Jigajinni
 
Chapter 04 object oriented programming
Chapter 04 object oriented programmingChapter 04 object oriented programming
Chapter 04 object oriented programmingPraveen M Jigajinni
 
Chapter 8 getting started with python
Chapter 8 getting started with pythonChapter 8 getting started with python
Chapter 8 getting started with pythonPraveen M Jigajinni
 
Chapter 7 basics of computational thinking
Chapter 7 basics of computational thinkingChapter 7 basics of computational thinking
Chapter 7 basics of computational thinkingPraveen M Jigajinni
 
Chapter 3 cloud computing and intro parrallel computing
Chapter 3 cloud computing and intro parrallel computingChapter 3 cloud computing and intro parrallel computing
Chapter 3 cloud computing and intro parrallel computingPraveen M Jigajinni
 

Mehr von Praveen M Jigajinni (20)

Chapter 09 design and analysis of algorithms
Chapter 09  design and analysis of algorithmsChapter 09  design and analysis of algorithms
Chapter 09 design and analysis of algorithms
 
Chapter 08 data file handling
Chapter 08 data file handlingChapter 08 data file handling
Chapter 08 data file handling
 
Chapter 07 inheritance
Chapter 07 inheritanceChapter 07 inheritance
Chapter 07 inheritance
 
Chapter 06 constructors and destructors
Chapter 06 constructors and destructorsChapter 06 constructors and destructors
Chapter 06 constructors and destructors
 
Chapter 05 classes and objects
Chapter 05 classes and objectsChapter 05 classes and objects
Chapter 05 classes and objects
 
Chapter 04 object oriented programming
Chapter 04 object oriented programmingChapter 04 object oriented programming
Chapter 04 object oriented programming
 
Chapter 03 python libraries
Chapter 03 python librariesChapter 03 python libraries
Chapter 03 python libraries
 
Chapter 02 functions -class xii
Chapter 02   functions -class xiiChapter 02   functions -class xii
Chapter 02 functions -class xii
 
Unit 3 MongDB
Unit 3 MongDBUnit 3 MongDB
Unit 3 MongDB
 
Chapter 17 Tuples
Chapter 17 TuplesChapter 17 Tuples
Chapter 17 Tuples
 
Chapter 15 Lists
Chapter 15 ListsChapter 15 Lists
Chapter 15 Lists
 
Chapter 14 strings
Chapter 14 stringsChapter 14 strings
Chapter 14 strings
 
Chapter 13 exceptional handling
Chapter 13 exceptional handlingChapter 13 exceptional handling
Chapter 13 exceptional handling
 
Chapter 10 data handling
Chapter 10 data handlingChapter 10 data handling
Chapter 10 data handling
 
Chapter 9 python fundamentals
Chapter 9 python fundamentalsChapter 9 python fundamentals
Chapter 9 python fundamentals
 
Chapter 8 getting started with python
Chapter 8 getting started with pythonChapter 8 getting started with python
Chapter 8 getting started with python
 
Chapter 7 basics of computational thinking
Chapter 7 basics of computational thinkingChapter 7 basics of computational thinking
Chapter 7 basics of computational thinking
 
Chapter 5 boolean algebra
Chapter 5 boolean algebraChapter 5 boolean algebra
Chapter 5 boolean algebra
 
Chapter 4 number system
Chapter 4 number systemChapter 4 number system
Chapter 4 number system
 
Chapter 3 cloud computing and intro parrallel computing
Chapter 3 cloud computing and intro parrallel computingChapter 3 cloud computing and intro parrallel computing
Chapter 3 cloud computing and intro parrallel computing
 

Kürzlich hochgeladen

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesShubhangi Sonawane
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIShubhangi Sonawane
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 

Kürzlich hochgeladen (20)

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 

Chapter 6 algorithms and flow charts

  • 1. CHAPTER 06 ALGORITHMS AND FLOW CHARTS Unit 1: XI Computer Science (083) Board : CBSE • Computer Systems and Organisation (CSO)
  • 2. Unit 1: XI Computer Science (083) Board : CBSE Courtesy CBSE Computer Systems and Organisation (CSO)
  • 3. Unit I 10 Theory + 02 Practical) Praveen M Jigajinni Prepared by Courtesy CBSE Computer Systems and Organisation (CSO) DCSc & Engg, PGDCA,ADCA,MCA.MSc(IT),Mtech(IT),MPhil (Comp. Sci) Department of Computer Science, Sainik School Amaravathinagar Cell No: 9431453730
  • 5.  able to define problem;  able to define algorithm;  write algorithms for simple problems;  explain properties of an algorithm;  the meaning of flowchart;  explain the need of flow chart;  explain different symbols used in flow chart;  draw flow chart for simple problems; and convert a flow chart into an algorithm and vice versa. ALGORITHM AND FLOW CHART OBJECTIVES
  • 6. ALGORITHM AND FLOW CHART Intelligence is one of the key characteristics which differentiate a human being from other living creatures on the earth. Basic intelligence covers day to day problem solving and making strategies to handle different situations which keep arising in day to day life. INTRODUCTION
  • 7. ALGORITHM AND FLOW CHART One person goes Bank to withdraw money. After knowing the balance in his account, he/she decides to withdraw the entire amount from his account but he/she has to leave minimum balance in his account. INTRODUCTION
  • 8. ALGORITHM AND FLOW CHART Here deciding about how much amount he/she may withdraw from the account is one of the example of the basic intelligence. During the process of solving any problem, one tries to find the necessary steps to be taken in a sequence. INTRODUCTION
  • 9. ALGORITHM AND FLOW CHART What is Algorithm? Algorithm can be defined as: “A sequ ence of activities to be processed for getti ng desired output from a given input.”
  • 10. ALGORITHM AND FLOW CHART What is Algorithm? Webopedia defines an algorithm as: “A formula or set of steps for solving a particularproblem. To be an algorithm, a set of rules must be unambiguous and have a cl ear stopping point”.
  • 11. MUHAMMAD IBN MUSA AL-KHWARIZMI Muḥammad ibn Mūsā al- Khwārizmī (Persian: ‫محمد‬‫بن‬‫موسى‬ ‫;خوارزمی‬ c. 780 – c. 850), Formerly Latinized as Algoritmi, was a Persian scholar who produced works in mathematics, astronomy, & geography under the patronage of the Caliph Al-Ma'mun of the Abbasid Caliphate. Around 820 AD he was appointed as the astronomer and head of the library of the House of Wisdom in Baghdad.
  • 12. PROPERTIES OF ALGORITHM Donald Ervin Knuth has given a list of five properties for an algorithm, these properties are: 1) FINITENESS 2) DEFINITENESS 3) INPUT 4) OUTPUT 5) EFFECTIVENESS
  • 13. PROPERTIES OF ALGORITHM 1) FINITENESS: An algorithm must always terminate after a finite number of steps. It means after every step one reach closer to solution of the problem and after a finite number of steps algorithm reaches to an end point.
  • 14. PROPERTIES OF ALGORITHM 2) DEFINITENESS Each step of an algorithm must be precisely defined. It is done by well thought actions to be performed at each step of the algorithm. Also the actions are defined unambiguously for each activity in the algorithm.
  • 15. PROPERTIES OF ALGORITHM 3) INPUT Any operation you perform need some beginning value/quantities associated with different activities in the operation. So the value/quantities are given to the algorithm before it begins.
  • 16. PROPERTIES OF ALGORITHM 4) OUTPUT: One always expects output/result (expected value/quantities) in terms of output from an algorithm. The result may be obtained at different stages of the algorithm. If some result is from the intermediate stage of the operation then it is known as intermediate result and result obtained at the end of algorithm is known as end result. The output is expected value/quantities always have a specified relation to the inputs.
  • 17. PROPERTIES OF ALGORITHM 5) EFFECTIVENESS: Algorithms to be developed/written using basic operations. Actually operations should be basic, so that even they can in principle be done exactly and in a finite amount of time by a person, by using paper and pencil only.
  • 18. PROPERTIES OF ALGORITHM Any algorithm should have all these five properties otherwise it will not fulfil the basic objective of solving a problem in finite time. As you have seen in previous examples, every step of an algorithm puts you closer to the solution
  • 19. ADVANTAGES OF ALGORITHM The use of algorithms provides a number of advantages. One of these advantages is in the development of the procedure itself, which involves identification of the processes, major decision points, and variables necessary to solve the problem. Developing an algorithm allows and even forces examination of the solution process in a rational manner.
  • 20. ADVANTAGES OF ALGORITHM Identification of the processes and decision points reduces the task into a series of smaller steps of more manageable size. Problems that would be difficult or impossible to solve wholesale can be approached as a series of small, solvable sub problems. The required specification aids in the identification and reduction of subconscious biases. By using an algorithm, decision-making becomes a more rational process.
  • 21. ADVANTAGES OF ALGORITHM In additional to making the process more rational, use of an algorithm will make the process more efficient and more consistent. Efficiency is an inherent result of the analysis and specification process. Consistency comes from both the use of the same specified process and increased skill in applying the process. An algorithm serves as a mnemonic device and helps ensure that variables or parts of the problem are not ignored.
  • 22. ADVANTAGES OF ALGORITHM Presenting the solution process as an algorithm allows more precise communication. Finally, separation of the procedure steps facilitates division of labor and development of expertise. A final benefit of the use of an algorithm comes from the improvement it makes possible. If the problem solver does not know what was done, he or she will not know what was done wrong.
  • 23. ADVANTAGES OF ALGORITHM As time goes by and results are compared with goals, the existence of a specified solution process allows identification of weaknesses and errors in the process. Reduction of a task to a specified set of steps or algorithm is an important part of analysis, control, and evaluation.
  • 24. DISADVANTAGES OF ALGORITHM One disadvantage of algorithms is that they always terminate, which means there are some computational procedures—occasionally even useful ones—which are not algorithms. Furthermore, all computational procedures, whether they terminate or not, can only give computable results, so you cannot, for example, design a program which determines a busy beaver number more quickly than could be done by actually running the associated types of Turing machines.
  • 25. ALGORITHM EXAMPLES Let us take one simple day-to-day example by writing algorithm for making, “Maggi Noodles‟ as a food. Step 1: Start Step 2: Take pan with water Step 3: Put pan on the burner Step 4: Switch on the gas/burner Step 5: Put magi and masala Step 6: Give two minutes to boil Step 7: Take off the pan Step 8: Take out the magi with the help of fork/spoon Step 9: Put the maggi on the plate and serve it Step 10: Stop.
  • 26. ALGORITHM EXAMPLES Write an algorithm to print “Good Morning‟ Step 1: Start Step 2: Print “Good Morning‟ Step 3: Stop
  • 27. ALGORITHM EXAMPLES Write an algorithm to find area of a rectangle. Step 1: Start Step 2: Take length and breadth and store them as L and B? Step 3: Multiply by L and B and store it in area Step 4: Print area Step 5: Stop
  • 28. ALGORITHM EXAMPLES Write an algorithm to check whether he is eligible to vote? (more than or equal to 18 years old). Step 1: Start Step 2: Take age and store it in age Step 3: Check age value, if age >= 18 then go to step 4 else step 5 Step 4: Print “Eligible to vote” and go to step 6 Step 5: Print “Not eligible to vote” Step 6: Stop
  • 29. ALGORITHM EXAMPLES Write an algorithm to check whether given number is +ve, -ve or zero. Step 1: Start Step 2: Take any number and store it in n. Step 3: Check n value, if n > 0 then go to step 5 else go to step 4 Step 4: Check n value, if n < 0 then go to step 6 else go to step 7
  • 30. ALGORITHM EXAMPLES Write an algorithm to check whether given number is +ve, -ve or zero. Step 5: Print “Given number is +ve”and go to step 8 Step 6: Print “Given number is -ve” and go to step 8 Step 7: Print “Given number is zero” Step 8: Stop
  • 32. The flowchart is a diagram which visually pre sents the flow of data through processing systems. This means by seeing a flow chart o ne can know the operations performed and the sequence of these operations in a syste m. Algorithms are nothing but sequence of steps for solving problems. So a flow chart ca n be used for representing an algorithm. A flowchart, will describe the operations (and in what sequence) are required to solve a given problem. FLOWCHART
  • 33. A flowchart is a type of diagram that represents an algorithm, workflow or process. The flowchart shows the steps as boxes of various kinds, and their order by connecting the boxes with arrows. This diagrammatic representation illustrates a solution model to a given problem. Flowcharts are used in analyzing, designing, documenting or managing a process or program in various fields. FLOWCHART
  • 35. The American National Standards Institute (ANSI) set standards for flowcharts and their symbols in the 1960s. The International Organization for Standardization(ISO) adopted the ANSI symbols in 1970. The current standard was revised in 1985. Generally, flowcharts flow from top to bottom and left to right. BUILDING BLOCKS OF FLOW CHART
  • 36. BUILDING BLOCKS OF FLOW CHART ANSI/ISO Shape Name Description Flowline (Arrowhead) Shows the process's order of operation. A line coming from one symbol and pointing at another. Arrowheads are added if the flow is not the standard top-to-bottom, left- to right.
  • 37. BUILDING BLOCKS OF FLOW CHART ANSI/ISO Shape Name Description Terminal Indicates the beginning and ending of a program or sub-process. Represented as a stadium, oval or rounded (fillet) rectangle. They usually contain the word "Start" or "End", or another phrase signaling the start or end of a process, such as "submit inquiry" or "receive product".
  • 38. BUILDING BLOCKS OF FLOW CHART ANSI/ISO Shape Name Description Process Represents a set of operations that changes value, form, or location of data. Represented as a rectangle
  • 39. BUILDING BLOCKS OF FLOW CHART ANSI/ISO Shape Name Description Decision Shows a conditional operation that determines which one of the two paths the program will take. The operation is commonly a yes/no question or true/false test. Represented as a diamond (rhombus).
  • 40. BUILDING BLOCKS OF FLOW CHART ANSI/ISO Shape Name Description Input / Output Indicates the process of inputting and outputting data, as in entering data or displaying results. Represented as a parallelogram
  • 41. BUILDING BLOCKS OF FLOW CHART ANSI/ISO Shape Name Description Annotation (Comment) Indicating additional information about a step the program. Represented as an open rectangle with a dashed or solid line connecting it to the corresponding symbol in the flowchart.
  • 42. BUILDING BLOCKS OF FLOW CHART ANSI/ISO Shape Name Description Predefined Process Functions Shows named process /Function which is defined elsewhere. Represented as a rectangle with double- struck vertical edges.
  • 43. BUILDING BLOCKS OF FLOW CHART ANSI/ISO Shape Name Description On-page Connector Pairs of labelled connectors replace long or confusing lines on a flowchart page. Represented by a small circle with a letter inside.
  • 44. BUILDING BLOCKS OF FLOW CHART ANSI/ISO Shape Name Description Off-page Connector A labelled connector for use when the target is on another page. Represented as a home plate- shaped pentagon.
  • 45. BUILDING BLOCKS OF FLOW CHART ANSI/ISO Shape Name Description Storage/ Backup Magnetic Tape used for sec ondary storage/Backup
  • 46. BUILDING BLOCKS OF FLOW CHART ANSI/ISO Shape Name Description Storage/ Backup Magnetic Disk used for sec ondary storage/Backup
  • 47. ADVANTAGES OF USING FLOWCHARTS As we discussed flow chart is used for representing algorithm in pictorial form. This pictorial representation of a solution/system is having many advantages. These advantages are as follows: 1. COMMUNICATION. 2. EFFECTIVE ANALYSIS. 3. DOCUMENTATION OF PROGRAM/SYSTEM. 4. EFFICIENT PROGRAM MAINTENANCE. 5. CODING OF THE PROGRAM.
  • 48. ADVANTAGES OF USING FLOWCHARTS 1. COMMUNICATION: A Flowchart can be used as a better way of communication of the logic of a system and steps involve in the solution, to all concerned particularly to the client of system.
  • 49. ADVANTAGES OF USING FLOWCHARTS 2. EFFECTIVE ANALYSIS: A flowchart of a problem can be used for effective analysis of the problem.
  • 50. ADVANTAGES OF USING FLOWCHARTS 3.DOCUMENTATION OF PROGRAM/ SYSTEM: Program flowcharts are a vital part of a good program documentation. Program document is used for various purposes like knowing the components in the program, complexity of the program etc.
  • 51. ADVANTAGES OF USING FLOWCHARTS 4. EFFICIENT PROGRAM MAINTENANCE: Once a program is developed and becomes operational it needs time to time maintenance. With help of flowchart maintenance become easier.
  • 52. ADVANTAGES OF USING FLOWCHARTS 5. CODING OF THE PROGRAM: Any design of solution of a problem is finally converted into computer program. Writing code referring the flowchart of the solution become easy.
  • 53. LIMITATIONS OF USING FLOWCHARTS 1) COMPLEXITY OF LOGIC: If program logic is complex then flowchart of the program becomes complicated. 2) ALTERATIONS AND MODIFICATIONS IN LOGIC: any alterations in the program logic may require redrawing of flowchart completely. 3) REUSE IS NOT POSSIBLE: As the flowchart symbols cannot be typed, always reproduction of flowchart symbols are required.
  • 54. FLOWCHART EXAMPLES Draw a flowchart to find the simple interest. (Sequence)
  • 55. FLOWCHART EXAMPLES Draw a flowchart to find bigger number among two numbers (selective)
  • 56. FLOWCHART EXAMPLES Draw a flow chart to find factorial of any number.
  • 58. FLOWCHART EXAMPLES Draw a flow chart to print the number from 1 to N.
  • 60. FLOWCHART EXAMPLES Draw a flow chart to find biggest number among N numbers.
  • 63. 1. A step by step method for solving a problem using English Language (a) program (b) Flowchart (c) statement (d) Algorithm 2. Set of statements is executed based upon conditional test. (a) Looping (b) Selective (c) Sequence (d) None MULTIPLE CHOICE QUESTIONS Time: 40 Min Max Marks 20
  • 64. 3. Set of statements is executed again and again based upon conditional test. (a) Looping (b) Selective (c) Sequence (d) None 4. The graphical representation of algorithm is (a) program (b) Flowchart (c) statement (d) Algorithm 5. All instructions are executed one after other. (a) Looping (b) Selective (c) Sequence (d) None MULTIPLE CHOICE QUESTIONS
  • 65. 1. Define Algorithm. 2. Define Flowchart. 3. Write an algorithm to find the sum of two numbers. 4. Write an algorithm to find the area of a triangle. 5. Write an algorithm to find whether given number is odd or even. ANSWER THE FOLLOWING QUESTIONS.
  • 66. 6. Write an algorithm to find the sum of all even number up to given number. 7. Draw a flowchart to find the area of a circle. 9. Draw a flowchart to find the smallest number among n numbers. ANSWER THE FOLLOWING QUESTIONS.
  • 67. 10. Draw a flowchart to find the sum of all multiples of 5 up to given number. 11. Mona is confused about finite loop and infinite loop, explain her with the help of example. 12. Write an algorithm and a flowchart to find sum of n numbers. ANSWER THE FOLLOWING QUESTIONS.