SlideShare a Scribd company logo
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

More Related Content

What's hot (20)

PPTX
Algorithm and flowchart
Shivam Sharma
 
PPTX
Flowcharts and algorithms
Student
 
PPTX
computer organization and assembly language Lec 01 coal_introduction
Zia3130
 
PPTX
Features of machine language, assembly language, high level language & their ...
SHUBHAM PATIDAR FISHERIES ADDAA
 
PPTX
Algorithm and flowchart
Elizabeth de Leon Aler
 
PPTX
Computer registers
DeepikaT13
 
PPTX
I/O Management
Keyur Vadodariya
 
PPTX
Batch operating system
Dilouar Hossain
 
PPTX
Algorithms and flowcharts
Samuel Igbanogu
 
PPTX
System bus
AmanLodhi3
 
PPT
Top down parsing
ASHOK KUMAR REDDY
 
PPT
Computer Organization and Assembly Language
fasihuddin90
 
PDF
Black Box Testing
Testbytes
 
PPTX
Distributed operating system
Prankit Mishra
 
PPTX
bus and memory tranfer (computer organaization)
Siddhi Viradiya
 
PDF
operating system structure
Waseem Ud Din Farooqui
 
PPT
Multi Head, Multi Tape Turing Machine
Radhakrishnan Chinnusamy
 
PPTX
What is an algorithm?
Angela DeHart
 
PPT
Lect 1. introduction to programming languages
Varun Garg
 
PPTX
Programming fundamentals lecture 4
Raja Hamid
 
Algorithm and flowchart
Shivam Sharma
 
Flowcharts and algorithms
Student
 
computer organization and assembly language Lec 01 coal_introduction
Zia3130
 
Features of machine language, assembly language, high level language & their ...
SHUBHAM PATIDAR FISHERIES ADDAA
 
Algorithm and flowchart
Elizabeth de Leon Aler
 
Computer registers
DeepikaT13
 
I/O Management
Keyur Vadodariya
 
Batch operating system
Dilouar Hossain
 
Algorithms and flowcharts
Samuel Igbanogu
 
System bus
AmanLodhi3
 
Top down parsing
ASHOK KUMAR REDDY
 
Computer Organization and Assembly Language
fasihuddin90
 
Black Box Testing
Testbytes
 
Distributed operating system
Prankit Mishra
 
bus and memory tranfer (computer organaization)
Siddhi Viradiya
 
operating system structure
Waseem Ud Din Farooqui
 
Multi Head, Multi Tape Turing Machine
Radhakrishnan Chinnusamy
 
What is an algorithm?
Angela DeHart
 
Lect 1. introduction to programming languages
Varun Garg
 
Programming fundamentals lecture 4
Raja Hamid
 

Similar to Chapter 6 algorithms and flow charts (20)

PPTX
11 Unit 1 Problem Solving Techniques
Praveen M Jigajinni
 
PPTX
Chapter 4 Algorithms and Flow Charts.pptx
AbhishekKumar351920
 
PDF
Algo and flowchart
Swapnil Suryavanshi
 
PPTX
Flow Chajhbhvhhhhhhhhhhhhhrts FOR BPE.pptx
develvin404
 
PPT
Lect 3-4 Zaheer Abbas
Information Technology Center
 
PPTX
Introduction to python Grade 10 with exercies.pptx
judynouran
 
PDF
Unit 1-problem solving with algorithm
rajkumar1631010038
 
PDF
PROGRAMMING IN C UNIT I.pdffffffffffffffffffffffffd
dinesh620610
 
PPTX
Algorithm for computational problematic sit
Saurabh846965
 
PPT
AOA Week 01.ppt
INAM352782
 
PDF
Design and Analysis Algorithms.pdf
HarshNagda5
 
PDF
Python Unit 1.pdfPython Notes for Bharathiar university syllabus
ANUSUYA S
 
PPTX
Problem-solving and design 1.pptx
TadiwaMawere
 
PDF
Algorithm Analysis.pdf
NayanChandak1
 
PDF
Basics of Algorithm Unit 1 part 1 algorithm
JIMS LAJPAT NAGAR
 
PPTX
FDFDRERSFDSGAGAFGGFGFGFGFGAFDGFDGFGFFAGFGGDF
AlthimeseAnderson
 
PPTX
Unit 1(1).pptx Program Logic Development
Vaibhav Parjane
 
PPT
Chap6
artipradhan
 
PDF
1.1 the introduction of design and analysis of algorithm
Mohammed khaja Jamaluddin
 
PPTX
UNIT 1.pptx
ShaswatSurya
 
11 Unit 1 Problem Solving Techniques
Praveen M Jigajinni
 
Chapter 4 Algorithms and Flow Charts.pptx
AbhishekKumar351920
 
Algo and flowchart
Swapnil Suryavanshi
 
Flow Chajhbhvhhhhhhhhhhhhhrts FOR BPE.pptx
develvin404
 
Lect 3-4 Zaheer Abbas
Information Technology Center
 
Introduction to python Grade 10 with exercies.pptx
judynouran
 
Unit 1-problem solving with algorithm
rajkumar1631010038
 
PROGRAMMING IN C UNIT I.pdffffffffffffffffffffffffd
dinesh620610
 
Algorithm for computational problematic sit
Saurabh846965
 
AOA Week 01.ppt
INAM352782
 
Design and Analysis Algorithms.pdf
HarshNagda5
 
Python Unit 1.pdfPython Notes for Bharathiar university syllabus
ANUSUYA S
 
Problem-solving and design 1.pptx
TadiwaMawere
 
Algorithm Analysis.pdf
NayanChandak1
 
Basics of Algorithm Unit 1 part 1 algorithm
JIMS LAJPAT NAGAR
 
FDFDRERSFDSGAGAFGGFGFGFGFGAFDGFDGFGFFAGFGGDF
AlthimeseAnderson
 
Unit 1(1).pptx Program Logic Development
Vaibhav Parjane
 
1.1 the introduction of design and analysis of algorithm
Mohammed khaja Jamaluddin
 
UNIT 1.pptx
ShaswatSurya
 
Ad

More from Praveen M Jigajinni (20)

PPTX
Chapter 09 design and analysis of algorithms
Praveen M Jigajinni
 
PPTX
Chapter 08 data file handling
Praveen M Jigajinni
 
PPTX
Chapter 07 inheritance
Praveen M Jigajinni
 
PPTX
Chapter 06 constructors and destructors
Praveen M Jigajinni
 
PPTX
Chapter 05 classes and objects
Praveen M Jigajinni
 
PPTX
Chapter 04 object oriented programming
Praveen M Jigajinni
 
PPTX
Chapter 03 python libraries
Praveen M Jigajinni
 
PPTX
Chapter 02 functions -class xii
Praveen M Jigajinni
 
PPTX
Unit 3 MongDB
Praveen M Jigajinni
 
PPTX
Chapter 17 Tuples
Praveen M Jigajinni
 
PPTX
Chapter 15 Lists
Praveen M Jigajinni
 
PPTX
Chapter 14 strings
Praveen M Jigajinni
 
PPTX
Chapter 13 exceptional handling
Praveen M Jigajinni
 
PPTX
Chapter 10 data handling
Praveen M Jigajinni
 
PPTX
Chapter 9 python fundamentals
Praveen M Jigajinni
 
PPTX
Chapter 8 getting started with python
Praveen M Jigajinni
 
PPTX
Chapter 7 basics of computational thinking
Praveen M Jigajinni
 
PPTX
Chapter 5 boolean algebra
Praveen M Jigajinni
 
PPTX
Chapter 4 number system
Praveen M Jigajinni
 
PPTX
Chapter 3 cloud computing and intro parrallel computing
Praveen M Jigajinni
 
Chapter 09 design and analysis of algorithms
Praveen M Jigajinni
 
Chapter 08 data file handling
Praveen M Jigajinni
 
Chapter 07 inheritance
Praveen M Jigajinni
 
Chapter 06 constructors and destructors
Praveen M Jigajinni
 
Chapter 05 classes and objects
Praveen M Jigajinni
 
Chapter 04 object oriented programming
Praveen M Jigajinni
 
Chapter 03 python libraries
Praveen M Jigajinni
 
Chapter 02 functions -class xii
Praveen M Jigajinni
 
Unit 3 MongDB
Praveen M Jigajinni
 
Chapter 17 Tuples
Praveen M Jigajinni
 
Chapter 15 Lists
Praveen M Jigajinni
 
Chapter 14 strings
Praveen M Jigajinni
 
Chapter 13 exceptional handling
Praveen M Jigajinni
 
Chapter 10 data handling
Praveen M Jigajinni
 
Chapter 9 python fundamentals
Praveen M Jigajinni
 
Chapter 8 getting started with python
Praveen M Jigajinni
 
Chapter 7 basics of computational thinking
Praveen M Jigajinni
 
Chapter 5 boolean algebra
Praveen M Jigajinni
 
Chapter 4 number system
Praveen M Jigajinni
 
Chapter 3 cloud computing and intro parrallel computing
Praveen M Jigajinni
 
Ad

Recently uploaded (20)

PPTX
DIGITAL CITIZENSHIP TOPIC TLE 8 MATATAG CURRICULUM
ROBERTAUGUSTINEFRANC
 
PDF
Council of Chalcedon Re-Examined
Smiling Lungs
 
PPTX
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
PPTX
How to Send Email From Odoo 18 Website - Odoo Slides
Celine George
 
PDF
AI-Powered-Visual-Storytelling-for-Nonprofits.pdf
TechSoup
 
PDF
Characteristics, Strengths and Weaknesses of Quantitative Research.pdf
Thelma Villaflores
 
PDF
Aprendendo Arquitetura Framework Salesforce - Dia 03
Mauricio Alexandre Silva
 
PPTX
How to Configure Re-Ordering From Portal in Odoo 18 Website
Celine George
 
PPTX
Nitrogen rule, ring rule, mc lafferty.pptx
nbisen2001
 
PDF
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
PPTX
PPT-Q1-WK-3-ENGLISH Revised Matatag Grade 3.pptx
reijhongidayawan02
 
PPTX
Introduction to Indian Writing in English
Trushali Dodiya
 
PDF
Week 2 - Irish Natural Heritage Powerpoint.pdf
swainealan
 
PPTX
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
PPTX
EDUCATIONAL MEDIA/ TEACHING AUDIO VISUAL AIDS
Sonali Gupta
 
PPTX
PPT-Q1-WEEK-3-SCIENCE-ERevised Matatag Grade 3.pptx
reijhongidayawan02
 
PPTX
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
PDF
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
PPTX
DAY 1_QUARTER1 ENGLISH 5 WEEK- PRESENTATION.pptx
BanyMacalintal
 
PDF
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
DIGITAL CITIZENSHIP TOPIC TLE 8 MATATAG CURRICULUM
ROBERTAUGUSTINEFRANC
 
Council of Chalcedon Re-Examined
Smiling Lungs
 
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
How to Send Email From Odoo 18 Website - Odoo Slides
Celine George
 
AI-Powered-Visual-Storytelling-for-Nonprofits.pdf
TechSoup
 
Characteristics, Strengths and Weaknesses of Quantitative Research.pdf
Thelma Villaflores
 
Aprendendo Arquitetura Framework Salesforce - Dia 03
Mauricio Alexandre Silva
 
How to Configure Re-Ordering From Portal in Odoo 18 Website
Celine George
 
Nitrogen rule, ring rule, mc lafferty.pptx
nbisen2001
 
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
PPT-Q1-WK-3-ENGLISH Revised Matatag Grade 3.pptx
reijhongidayawan02
 
Introduction to Indian Writing in English
Trushali Dodiya
 
Week 2 - Irish Natural Heritage Powerpoint.pdf
swainealan
 
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
EDUCATIONAL MEDIA/ TEACHING AUDIO VISUAL AIDS
Sonali Gupta
 
PPT-Q1-WEEK-3-SCIENCE-ERevised Matatag Grade 3.pptx
reijhongidayawan02
 
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
DAY 1_QUARTER1 ENGLISH 5 WEEK- PRESENTATION.pptx
BanyMacalintal
 
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 

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.