SlideShare a Scribd company logo
University of Mysore
Sub:- Fundamentals of Information Technology
Seminar Topic:- Algorithms and Flowcharts
Submitted To
Prof.Chandrashekar.M
DOS in lis
Manasagangori
Mysore
Submitted By
Nagendra N
Dos in Lib and Inf.science
Manasagangotri
Mysore
ALGORITHMS AND
FLOWCHARTS
Nagendra N
ALGORITHMS AND FLOWCHARTS
 A typical programming task can be divided into
two phases:
 Problem solving phase
 produce an ordered sequence of steps that describe
solution of problem
 this sequence of steps is called an algorithm
 Implementation phase
 implement the program in some programming
language
Steps in Problem Solving
 First produce a general algorithm (one can use
pseudocode)
 Refine the algorithm successively to get step by
step detailed algorithm that is very close to a
computer language.
 Pseudocode is an artificial and informal
language that helps programmers develop
algorithms. Pseudocode is very similar to
everyday English.
Pseudocode & Algorithm
 Example 1: Write an algorithm to
determine a student’s final grade and
indicate whether it is passing or failing.
The final grade is calculated as the
average of four marks.
Pseudocode & Algorithm
Pseudocode:
 Input a set of 4 marks
 Calculate their average by summing and dividing
by 4
 if average is below 50
Print “FAIL”
else
Print “PASS”
Pseudocode & Algorithm
 Detailed Algorithm
 Step 1: Input M1,M2,M3,M4
Step 2: GRADE ← (M1+M2+M3+M4)/4
Step 3: if (GRADE < 50) then
Print “FAIL”
else
Print “PASS”
endif
The Flowchart
 (Dictionary) A schematic representation of a sequence of
operations, as in a manufacturing process or computer
program.
 (Technical) A graphical representation of the sequence
of operations in an information system or program.
Information system flowcharts show how data flows from
source documents through the computer to final
distribution to users. Program flowcharts show the
sequence of instructions in a single program or
subroutine. Different symbols are used to draw each
type of flowchart.
The Flowchart
A Flowchart
shows logic of an algorithm
emphasizes individual steps and their
interconnections
e.g. control flow from one action to the next
Flowchart Symbols
Basic
Example
PRINT
“PASS”
Step 1: Input M1,M2,M3,M4
Step 2: GRADE ← (M1+M2+M3+M4)/4
Step 3: if (GRADE <50) then
Print “FAIL”
else
Print “PASS”
endif
START
Input
M1,M2,M3,M4
GRADE←(M1+M2+M3+M4)/4
IS
GRADE<50
PRINT
“FAIL”
STOP
YN
Example 2
 Write an algorithm and draw a flowchart to
convert the length in feet to centimeter.
Pseudocode:
 Input the length in feet (Lft)
 Calculate the length in cm (Lcm) by
multiplying LFT with 30
 Print length in cm (LCM)
Example 2
Algorithm
 Step 1: Input Lft
 Step 2: Lcm ← Lft x 30
 Step 3: Print Lcm
START
Input
Lft
Lcm ← Lft x 30
Print
Lcm
STOP
Flowchart
Example 3
Write an algorithm and draw a flowchart that
will read the two sides of a rectangle and
calculate its area.
Pseudocode
 Input the width (W) and Length (L) of a rectangle
 Calculate the area (A) by multiplying L with W
 Print A
Example 3
Algorithm
 Step 1: Input W,L
 Step 2: A ← L x W
 Step 3: Print A
START
Input
W, L
A ← L x W
Print
A
STOP
Example 4
 Write an algorithm and draw a flowchart that
will calculate the roots of a quadratic equation
 Hint: d = sqrt ( ), and the roots are:
x1 = (–b + d)/2a and x2 = (–b – d)/2a
2
0ax bx c+ + =
2
4b ac−
Example 4
Pseudocode:
 Input the coefficients (a, b, c) of the
quadratic equation
 Calculate d
 Calculate x1
 Calculate x2
 Print x1 and x2
Example 4
 Algorithm:
 Step 1: Input a, b, c
 Step 2: d ← sqrt ( )
 Step 3: x1 ← (–b + d) / (2 x a)
 Step 4: x2 ← (–b – d) / (2 x a)
 Step 5: Print x1, x2
START
Input
a, b, c
d ← sqrt(b x b – 4 x a x c)
Print
x1 ,x2
STOP
x1 ←(–b + d) / (2 x a)
X2 ← (–b – d) / (2 x a)
4b b a c× − × ×
DECISION STRUCTURES
 The expression A>B is a logical expression
 it describes a condition we want to test
 if A>B is true (if A is greater than B) we take
the action on left
 print the value of A
 if A>B is false (if A is not greater than B) we
take the action on right
 print the value of B
DECISION STRUCTURES
is
A>B
Print BPrint A
Y N
IF–THEN–ELSE STRUCTURE
 The structure is as follows
If condition then
true alternative
else
false alternative
endif
IF–THEN–ELSE STRUCTURE
 The algorithm for the flowchart is as
follows:
If A>B then
print A
else
print B
endif
is
A>B
Print BPrint A
Y N
Relational Operators
Relational Operators
Operator Description
> Greater than
< Less than
= Equal to
≥ Greater than or equal to
≤ Less than or equal to
≠ Not equal to
Example 5
 Write an algorithm that reads two values, determines the
largest value and prints the largest value with an
identifying message.
ALGORITHM
Step 1: Input VALUE1, VALUE2
Step 2: if (VALUE1 > VALUE2) then
MAX ← VALUE1
else
MAX ← VALUE2
endif
Step 3: Print “The largest value is”, MAX
Example 5
MAX ← VALUE1
Print
“The largest value is”, MAX
STOP
Y N
START
Input
VALUE1,VALUE2
MAX ← VALUE2
is
VALUE1>VALUE2
NESTED IFS
 One of the alternatives within an IF–
THEN–ELSE statement
may involve further IF–THEN–ELSE
statement
Example 6
 Write an algorithm that reads three
numbers and prints the value of the
largest number.
Example 6
Step 1: Input N1, N2, N3
Step 2: if (N1>N2) then
if (N1>N3) then
MAX ← N1 [N1>N2, N1>N3]
else
MAX ← N3 [N3>N1>N2]
endif
else
if (N2>N3) then
MAX ← N2 [N2>N1, N2>N3]
else
MAX ← N3 [N3>N2>N1]
endif
endif
Step 3: Print “The largest number is”, MAX
Example 7
 Write and algorithm and draw a flowchart
to
a) read an employee name (NAME),
overtime hours worked (OVERTIME),
hours absent (ABSENT) and
b) determine the bonus payment
(PAYMENT).
Example 7
Bonus Schedule
OVERTIME – (2/3)*ABSENT Bonus Paid
>40 hours
>30 but ≤ 40 hours
>20 but ≤ 30 hours
>10 but ≤ 20 hours
≤ 10 hours
$50
$40
$30
$20
$10
Step 1: Input NAME,OVERTIME,ABSENT
Step 2: if (OVERTIME–(2/3)*ABSENT > 40) then
PAYMENT ← 50
else if (OVERTIME–(2/3)*ABSENT > 30) then
PAYMENT ← 40
else if (OVERTIME–(2/3)*ABSENT > 20) then
PAYMENT ← 30
else if (OVERTIME–(2/3)*ABSENT > 10) then
PAYMENT ←20
else
PAYMENT ← 10
endif
Step 3: Print “Bonus for”, NAME “is $”, PAYMENT
Conclusion
 An algorithm is an effective method that can be expressed within
a finite amount of space and timeand in a well-defined formal
language for calculating a function. Starting from an initial state
and initial input (perhaps empty, the instructions describe a
computation that, when executed, proceeds through a finite
number of well-defined successive states, eventually producing
"output"]
and terminating at a final ending state. The transition
from one state to the next is not necessarily deterministic; some
algorithms, known as randomized algorithms, incorporate
random input.
Conclusion
Flowcharts are used in designing and
documenting simple processes or programs.
Like other types of diagrams, they help
visualize what is going on and thereby help
understand a process, and perhaps also find
flaws, bottlenecks, and other less-obvious
features within it.
 Algorithms and flowcharts  ppt (seminar presentation)..

More Related Content

What's hot

Complexity of Algorithm
Complexity of AlgorithmComplexity of Algorithm
Complexity of Algorithm
Muhammad Muzammal
 
Forward and Backward chaining in AI
Forward and Backward chaining in AIForward and Backward chaining in AI
Forward and Backward chaining in AI
Megha Sharma
 
Algorithm and Flowcharts
Algorithm and FlowchartsAlgorithm and Flowcharts
Algorithm and Flowcharts
SURBHI SAROHA
 
Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)
swapnac12
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchart
Elizabeth de Leon Aler
 
Algorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to AlgorithmsAlgorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to Algorithms
Mohamed Loey
 
SEARCHING AND SORTING ALGORITHMS
SEARCHING AND SORTING ALGORITHMSSEARCHING AND SORTING ALGORITHMS
SEARCHING AND SORTING ALGORITHMS
Gokul Hari
 
Time space trade off
Time space trade offTime space trade off
Time space trade off
anisha talwar
 
Greedy Algorihm
Greedy AlgorihmGreedy Algorihm
Greedy Algorihm
Muhammad Amjad Rana
 
Algorithm
AlgorithmAlgorithm
Algorithm
IHTISHAM UL HAQ
 
Data structures chapter 1
Data structures chapter  1Data structures chapter  1
Data structures chapter 1
priyavanimurugarajan
 
Rule based system
Rule based systemRule based system
Rule based system
Dr. C.V. Suresh Babu
 
Binary search in data structure
Binary search in data structureBinary search in data structure
Binary search in data structure
Meherul1234
 
Data structures and algorithms
Data structures and algorithmsData structures and algorithms
Data structures and algorithms
Julie Iskander
 
Problem Solving Techniques and Introduction to C
Problem Solving Techniques and Introduction to CProblem Solving Techniques and Introduction to C
Problem Solving Techniques and Introduction to C
Prabu U
 
Theory of Computation
Theory of ComputationTheory of Computation
Theory of Computation
Shiraz316
 
Array in c++
Array in c++Array in c++
Array in c++
Mahesha Mano
 
Principle of mathematical induction
Principle of mathematical inductionPrinciple of mathematical induction
Principle of mathematical induction
Kriti Varshney
 
Time and Space Complexity
Time and Space ComplexityTime and Space Complexity
Time and Space Complexity
Ashutosh Satapathy
 
Divide and conquer
Divide and conquerDivide and conquer
Divide and conquer
Dr Shashikant Athawale
 

What's hot (20)

Complexity of Algorithm
Complexity of AlgorithmComplexity of Algorithm
Complexity of Algorithm
 
Forward and Backward chaining in AI
Forward and Backward chaining in AIForward and Backward chaining in AI
Forward and Backward chaining in AI
 
Algorithm and Flowcharts
Algorithm and FlowchartsAlgorithm and Flowcharts
Algorithm and Flowcharts
 
Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchart
 
Algorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to AlgorithmsAlgorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to Algorithms
 
SEARCHING AND SORTING ALGORITHMS
SEARCHING AND SORTING ALGORITHMSSEARCHING AND SORTING ALGORITHMS
SEARCHING AND SORTING ALGORITHMS
 
Time space trade off
Time space trade offTime space trade off
Time space trade off
 
Greedy Algorihm
Greedy AlgorihmGreedy Algorihm
Greedy Algorihm
 
Algorithm
AlgorithmAlgorithm
Algorithm
 
Data structures chapter 1
Data structures chapter  1Data structures chapter  1
Data structures chapter 1
 
Rule based system
Rule based systemRule based system
Rule based system
 
Binary search in data structure
Binary search in data structureBinary search in data structure
Binary search in data structure
 
Data structures and algorithms
Data structures and algorithmsData structures and algorithms
Data structures and algorithms
 
Problem Solving Techniques and Introduction to C
Problem Solving Techniques and Introduction to CProblem Solving Techniques and Introduction to C
Problem Solving Techniques and Introduction to C
 
Theory of Computation
Theory of ComputationTheory of Computation
Theory of Computation
 
Array in c++
Array in c++Array in c++
Array in c++
 
Principle of mathematical induction
Principle of mathematical inductionPrinciple of mathematical induction
Principle of mathematical induction
 
Time and Space Complexity
Time and Space ComplexityTime and Space Complexity
Time and Space Complexity
 
Divide and conquer
Divide and conquerDivide and conquer
Divide and conquer
 

Similar to Algorithms and flowcharts ppt (seminar presentation)..

Algorithmsandflowcharts1
Algorithmsandflowcharts1Algorithmsandflowcharts1
Algorithmsandflowcharts1
rajnidhiman
 
Algorithmsandflowcharts1
Algorithmsandflowcharts1Algorithmsandflowcharts1
Algorithmsandflowcharts1
ወዲ ህዝቢ
 
1153 algorithms%20and%20flowcharts
1153 algorithms%20and%20flowcharts1153 algorithms%20and%20flowcharts
1153 algorithms%20and%20flowcharts
Dani Garnida
 
Algorithmsandflowcharts1
Algorithmsandflowcharts1Algorithmsandflowcharts1
Algorithmsandflowcharts1
Emmanuel Alimpolos
 
Algorithms and flowcharts
Algorithms and flowchartsAlgorithms and flowcharts
Algorithms and flowcharts
khair20
 
Best Techniques To Design Programs - Program Designing Techniques
Best Techniques To Design Programs - Program Designing TechniquesBest Techniques To Design Programs - Program Designing Techniques
Best Techniques To Design Programs - Program Designing Techniques
Tech
 
Algorithms and flowcharts1
Algorithms and flowcharts1Algorithms and flowcharts1
Algorithms and flowcharts1
Lincoln School
 
Algorithmsandflowcharts1
Algorithmsandflowcharts1Algorithmsandflowcharts1
Algorithmsandflowcharts1
luhkahreth
 
Algorithmsandflowcharts1
Algorithmsandflowcharts1Algorithmsandflowcharts1
Algorithmsandflowcharts1
Jesuraj Love
 
256958.ppt
256958.ppt256958.ppt
256958.ppt
Bimlesh7
 
01 Algorithms And Flowcharts.ppt
01 Algorithms And Flowcharts.ppt01 Algorithms And Flowcharts.ppt
01 Algorithms And Flowcharts.ppt
FerdieBalang
 
ALGORITHMS AND FLOWCHARTS
ALGORITHMS AND FLOWCHARTSALGORITHMS AND FLOWCHARTS
ALGORITHMS AND FLOWCHARTS
Kate Campbell
 
Program design techniques
Program design techniquesProgram design techniques
Program design techniques
fika sweety
 
Programming fundamentals lecture 2 of c
Programming fundamentals lecture 2 of cProgramming fundamentals lecture 2 of c
Programming fundamentals lecture 2 of c
Raja Hamid
 
Algorithms and flowcharts
Algorithms and flowchartsAlgorithms and flowcharts
Algorithms and flowcharts
Samuel Igbanogu
 
Programming fundamentals lecture 4
Programming fundamentals lecture 4Programming fundamentals lecture 4
Programming fundamentals lecture 4
Raja Hamid
 
3 algorithm-and-flowchart
3 algorithm-and-flowchart3 algorithm-and-flowchart
3 algorithm-and-flowchart
Rohit Shrivastava
 
Problem solving using computers - Unit 1 - Study material
Problem solving using computers - Unit 1 - Study materialProblem solving using computers - Unit 1 - Study material
Problem solving using computers - Unit 1 - Study material
To Sum It Up
 
Lecture1-Algorithms-and-Flowcharts-ppt.ppt
Lecture1-Algorithms-and-Flowcharts-ppt.pptLecture1-Algorithms-and-Flowcharts-ppt.ppt
Lecture1-Algorithms-and-Flowcharts-ppt.ppt
ReshuReshma8
 
Programming algorithms and flowchart.ppt
Programming algorithms and flowchart.pptProgramming algorithms and flowchart.ppt
Programming algorithms and flowchart.ppt
VictorMorcillo1
 

Similar to Algorithms and flowcharts ppt (seminar presentation).. (20)

Algorithmsandflowcharts1
Algorithmsandflowcharts1Algorithmsandflowcharts1
Algorithmsandflowcharts1
 
Algorithmsandflowcharts1
Algorithmsandflowcharts1Algorithmsandflowcharts1
Algorithmsandflowcharts1
 
1153 algorithms%20and%20flowcharts
1153 algorithms%20and%20flowcharts1153 algorithms%20and%20flowcharts
1153 algorithms%20and%20flowcharts
 
Algorithmsandflowcharts1
Algorithmsandflowcharts1Algorithmsandflowcharts1
Algorithmsandflowcharts1
 
Algorithms and flowcharts
Algorithms and flowchartsAlgorithms and flowcharts
Algorithms and flowcharts
 
Best Techniques To Design Programs - Program Designing Techniques
Best Techniques To Design Programs - Program Designing TechniquesBest Techniques To Design Programs - Program Designing Techniques
Best Techniques To Design Programs - Program Designing Techniques
 
Algorithms and flowcharts1
Algorithms and flowcharts1Algorithms and flowcharts1
Algorithms and flowcharts1
 
Algorithmsandflowcharts1
Algorithmsandflowcharts1Algorithmsandflowcharts1
Algorithmsandflowcharts1
 
Algorithmsandflowcharts1
Algorithmsandflowcharts1Algorithmsandflowcharts1
Algorithmsandflowcharts1
 
256958.ppt
256958.ppt256958.ppt
256958.ppt
 
01 Algorithms And Flowcharts.ppt
01 Algorithms And Flowcharts.ppt01 Algorithms And Flowcharts.ppt
01 Algorithms And Flowcharts.ppt
 
ALGORITHMS AND FLOWCHARTS
ALGORITHMS AND FLOWCHARTSALGORITHMS AND FLOWCHARTS
ALGORITHMS AND FLOWCHARTS
 
Program design techniques
Program design techniquesProgram design techniques
Program design techniques
 
Programming fundamentals lecture 2 of c
Programming fundamentals lecture 2 of cProgramming fundamentals lecture 2 of c
Programming fundamentals lecture 2 of c
 
Algorithms and flowcharts
Algorithms and flowchartsAlgorithms and flowcharts
Algorithms and flowcharts
 
Programming fundamentals lecture 4
Programming fundamentals lecture 4Programming fundamentals lecture 4
Programming fundamentals lecture 4
 
3 algorithm-and-flowchart
3 algorithm-and-flowchart3 algorithm-and-flowchart
3 algorithm-and-flowchart
 
Problem solving using computers - Unit 1 - Study material
Problem solving using computers - Unit 1 - Study materialProblem solving using computers - Unit 1 - Study material
Problem solving using computers - Unit 1 - Study material
 
Lecture1-Algorithms-and-Flowcharts-ppt.ppt
Lecture1-Algorithms-and-Flowcharts-ppt.pptLecture1-Algorithms-and-Flowcharts-ppt.ppt
Lecture1-Algorithms-and-Flowcharts-ppt.ppt
 
Programming algorithms and flowchart.ppt
Programming algorithms and flowchart.pptProgramming algorithms and flowchart.ppt
Programming algorithms and flowchart.ppt
 

More from Nagendra N

Marc 21
Marc 21Marc 21
Marc 21
Nagendra N
 
Conference proceeding ppt
Conference proceeding pptConference proceeding ppt
Conference proceeding ppt
Nagendra N
 
writting skills
writting skillswritting skills
writting skills
Nagendra N
 
Proffessional ethics
Proffessional ethicsProffessional ethics
Proffessional ethics
Nagendra N
 
Writing a research article
Writing a research articleWriting a research article
Writing a research article
Nagendra N
 
Compendex and ISI
Compendex and ISICompendex and ISI
Compendex and ISI
Nagendra N
 
Seminar ppt hazards to library
Seminar ppt hazards to librarySeminar ppt hazards to library
Seminar ppt hazards to library
Nagendra N
 
Stock verification PPt
Stock verification PPtStock verification PPt
Stock verification PPt
Nagendra N
 

More from Nagendra N (8)

Marc 21
Marc 21Marc 21
Marc 21
 
Conference proceeding ppt
Conference proceeding pptConference proceeding ppt
Conference proceeding ppt
 
writting skills
writting skillswritting skills
writting skills
 
Proffessional ethics
Proffessional ethicsProffessional ethics
Proffessional ethics
 
Writing a research article
Writing a research articleWriting a research article
Writing a research article
 
Compendex and ISI
Compendex and ISICompendex and ISI
Compendex and ISI
 
Seminar ppt hazards to library
Seminar ppt hazards to librarySeminar ppt hazards to library
Seminar ppt hazards to library
 
Stock verification PPt
Stock verification PPtStock verification PPt
Stock verification PPt
 

Recently uploaded

Equivariant neural networks and representation theory
Equivariant neural networks and representation theoryEquivariant neural networks and representation theory
Equivariant neural networks and representation theory
Daniel Tubbenhauer
 
Travis Hills' Endeavors in Minnesota: Fostering Environmental and Economic Pr...
Travis Hills' Endeavors in Minnesota: Fostering Environmental and Economic Pr...Travis Hills' Endeavors in Minnesota: Fostering Environmental and Economic Pr...
Travis Hills' Endeavors in Minnesota: Fostering Environmental and Economic Pr...
Travis Hills MN
 
8.Isolation of pure cultures and preservation of cultures.pdf
8.Isolation of pure cultures and preservation of cultures.pdf8.Isolation of pure cultures and preservation of cultures.pdf
8.Isolation of pure cultures and preservation of cultures.pdf
by6843629
 
Phenomics assisted breeding in crop improvement
Phenomics assisted breeding in crop improvementPhenomics assisted breeding in crop improvement
Phenomics assisted breeding in crop improvement
IshaGoswami9
 
Chapter 12 - climate change and the energy crisis
Chapter 12 - climate change and the energy crisisChapter 12 - climate change and the energy crisis
Chapter 12 - climate change and the energy crisis
tonzsalvador2222
 
SAR of Medicinal Chemistry 1st by dk.pdf
SAR of Medicinal Chemistry 1st by dk.pdfSAR of Medicinal Chemistry 1st by dk.pdf
SAR of Medicinal Chemistry 1st by dk.pdf
KrushnaDarade1
 
如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样
如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样
如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样
yqqaatn0
 
Randomised Optimisation Algorithms in DAPHNE
Randomised Optimisation Algorithms in DAPHNERandomised Optimisation Algorithms in DAPHNE
Randomised Optimisation Algorithms in DAPHNE
University of Maribor
 
aziz sancar nobel prize winner: from mardin to nobel
aziz sancar nobel prize winner: from mardin to nobelaziz sancar nobel prize winner: from mardin to nobel
aziz sancar nobel prize winner: from mardin to nobel
İsa Badur
 
Bob Reedy - Nitrate in Texas Groundwater.pdf
Bob Reedy - Nitrate in Texas Groundwater.pdfBob Reedy - Nitrate in Texas Groundwater.pdf
Bob Reedy - Nitrate in Texas Groundwater.pdf
Texas Alliance of Groundwater Districts
 
Deep Software Variability and Frictionless Reproducibility
Deep Software Variability and Frictionless ReproducibilityDeep Software Variability and Frictionless Reproducibility
Deep Software Variability and Frictionless Reproducibility
University of Rennes, INSA Rennes, Inria/IRISA, CNRS
 
Eukaryotic Transcription Presentation.pptx
Eukaryotic Transcription Presentation.pptxEukaryotic Transcription Presentation.pptx
Eukaryotic Transcription Presentation.pptx
RitabrataSarkar3
 
EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...
EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...
EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...
Sérgio Sacani
 
Deep Behavioral Phenotyping in Systems Neuroscience for Functional Atlasing a...
Deep Behavioral Phenotyping in Systems Neuroscience for Functional Atlasing a...Deep Behavioral Phenotyping in Systems Neuroscience for Functional Atlasing a...
Deep Behavioral Phenotyping in Systems Neuroscience for Functional Atlasing a...
Ana Luísa Pinho
 
NuGOweek 2024 Ghent programme overview flyer
NuGOweek 2024 Ghent programme overview flyerNuGOweek 2024 Ghent programme overview flyer
NuGOweek 2024 Ghent programme overview flyer
pablovgd
 
BREEDING METHODS FOR DISEASE RESISTANCE.pptx
BREEDING METHODS FOR DISEASE RESISTANCE.pptxBREEDING METHODS FOR DISEASE RESISTANCE.pptx
BREEDING METHODS FOR DISEASE RESISTANCE.pptx
RASHMI M G
 
Remote Sensing and Computational, Evolutionary, Supercomputing, and Intellige...
Remote Sensing and Computational, Evolutionary, Supercomputing, and Intellige...Remote Sensing and Computational, Evolutionary, Supercomputing, and Intellige...
Remote Sensing and Computational, Evolutionary, Supercomputing, and Intellige...
University of Maribor
 
Nucleophilic Addition of carbonyl compounds.pptx
Nucleophilic Addition of carbonyl  compounds.pptxNucleophilic Addition of carbonyl  compounds.pptx
Nucleophilic Addition of carbonyl compounds.pptx
SSR02
 
Unlocking the mysteries of reproduction: Exploring fecundity and gonadosomati...
Unlocking the mysteries of reproduction: Exploring fecundity and gonadosomati...Unlocking the mysteries of reproduction: Exploring fecundity and gonadosomati...
Unlocking the mysteries of reproduction: Exploring fecundity and gonadosomati...
AbdullaAlAsif1
 
Sharlene Leurig - Enabling Onsite Water Use with Net Zero Water
Sharlene Leurig - Enabling Onsite Water Use with Net Zero WaterSharlene Leurig - Enabling Onsite Water Use with Net Zero Water
Sharlene Leurig - Enabling Onsite Water Use with Net Zero Water
Texas Alliance of Groundwater Districts
 

Recently uploaded (20)

Equivariant neural networks and representation theory
Equivariant neural networks and representation theoryEquivariant neural networks and representation theory
Equivariant neural networks and representation theory
 
Travis Hills' Endeavors in Minnesota: Fostering Environmental and Economic Pr...
Travis Hills' Endeavors in Minnesota: Fostering Environmental and Economic Pr...Travis Hills' Endeavors in Minnesota: Fostering Environmental and Economic Pr...
Travis Hills' Endeavors in Minnesota: Fostering Environmental and Economic Pr...
 
8.Isolation of pure cultures and preservation of cultures.pdf
8.Isolation of pure cultures and preservation of cultures.pdf8.Isolation of pure cultures and preservation of cultures.pdf
8.Isolation of pure cultures and preservation of cultures.pdf
 
Phenomics assisted breeding in crop improvement
Phenomics assisted breeding in crop improvementPhenomics assisted breeding in crop improvement
Phenomics assisted breeding in crop improvement
 
Chapter 12 - climate change and the energy crisis
Chapter 12 - climate change and the energy crisisChapter 12 - climate change and the energy crisis
Chapter 12 - climate change and the energy crisis
 
SAR of Medicinal Chemistry 1st by dk.pdf
SAR of Medicinal Chemistry 1st by dk.pdfSAR of Medicinal Chemistry 1st by dk.pdf
SAR of Medicinal Chemistry 1st by dk.pdf
 
如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样
如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样
如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样
 
Randomised Optimisation Algorithms in DAPHNE
Randomised Optimisation Algorithms in DAPHNERandomised Optimisation Algorithms in DAPHNE
Randomised Optimisation Algorithms in DAPHNE
 
aziz sancar nobel prize winner: from mardin to nobel
aziz sancar nobel prize winner: from mardin to nobelaziz sancar nobel prize winner: from mardin to nobel
aziz sancar nobel prize winner: from mardin to nobel
 
Bob Reedy - Nitrate in Texas Groundwater.pdf
Bob Reedy - Nitrate in Texas Groundwater.pdfBob Reedy - Nitrate in Texas Groundwater.pdf
Bob Reedy - Nitrate in Texas Groundwater.pdf
 
Deep Software Variability and Frictionless Reproducibility
Deep Software Variability and Frictionless ReproducibilityDeep Software Variability and Frictionless Reproducibility
Deep Software Variability and Frictionless Reproducibility
 
Eukaryotic Transcription Presentation.pptx
Eukaryotic Transcription Presentation.pptxEukaryotic Transcription Presentation.pptx
Eukaryotic Transcription Presentation.pptx
 
EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...
EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...
EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...
 
Deep Behavioral Phenotyping in Systems Neuroscience for Functional Atlasing a...
Deep Behavioral Phenotyping in Systems Neuroscience for Functional Atlasing a...Deep Behavioral Phenotyping in Systems Neuroscience for Functional Atlasing a...
Deep Behavioral Phenotyping in Systems Neuroscience for Functional Atlasing a...
 
NuGOweek 2024 Ghent programme overview flyer
NuGOweek 2024 Ghent programme overview flyerNuGOweek 2024 Ghent programme overview flyer
NuGOweek 2024 Ghent programme overview flyer
 
BREEDING METHODS FOR DISEASE RESISTANCE.pptx
BREEDING METHODS FOR DISEASE RESISTANCE.pptxBREEDING METHODS FOR DISEASE RESISTANCE.pptx
BREEDING METHODS FOR DISEASE RESISTANCE.pptx
 
Remote Sensing and Computational, Evolutionary, Supercomputing, and Intellige...
Remote Sensing and Computational, Evolutionary, Supercomputing, and Intellige...Remote Sensing and Computational, Evolutionary, Supercomputing, and Intellige...
Remote Sensing and Computational, Evolutionary, Supercomputing, and Intellige...
 
Nucleophilic Addition of carbonyl compounds.pptx
Nucleophilic Addition of carbonyl  compounds.pptxNucleophilic Addition of carbonyl  compounds.pptx
Nucleophilic Addition of carbonyl compounds.pptx
 
Unlocking the mysteries of reproduction: Exploring fecundity and gonadosomati...
Unlocking the mysteries of reproduction: Exploring fecundity and gonadosomati...Unlocking the mysteries of reproduction: Exploring fecundity and gonadosomati...
Unlocking the mysteries of reproduction: Exploring fecundity and gonadosomati...
 
Sharlene Leurig - Enabling Onsite Water Use with Net Zero Water
Sharlene Leurig - Enabling Onsite Water Use with Net Zero WaterSharlene Leurig - Enabling Onsite Water Use with Net Zero Water
Sharlene Leurig - Enabling Onsite Water Use with Net Zero Water
 

Algorithms and flowcharts ppt (seminar presentation)..

  • 1. University of Mysore Sub:- Fundamentals of Information Technology Seminar Topic:- Algorithms and Flowcharts Submitted To Prof.Chandrashekar.M DOS in lis Manasagangori Mysore Submitted By Nagendra N Dos in Lib and Inf.science Manasagangotri Mysore
  • 3. ALGORITHMS AND FLOWCHARTS  A typical programming task can be divided into two phases:  Problem solving phase  produce an ordered sequence of steps that describe solution of problem  this sequence of steps is called an algorithm  Implementation phase  implement the program in some programming language
  • 4. Steps in Problem Solving  First produce a general algorithm (one can use pseudocode)  Refine the algorithm successively to get step by step detailed algorithm that is very close to a computer language.  Pseudocode is an artificial and informal language that helps programmers develop algorithms. Pseudocode is very similar to everyday English.
  • 5. Pseudocode & Algorithm  Example 1: Write an algorithm to determine a student’s final grade and indicate whether it is passing or failing. The final grade is calculated as the average of four marks.
  • 6. Pseudocode & Algorithm Pseudocode:  Input a set of 4 marks  Calculate their average by summing and dividing by 4  if average is below 50 Print “FAIL” else Print “PASS”
  • 7. Pseudocode & Algorithm  Detailed Algorithm  Step 1: Input M1,M2,M3,M4 Step 2: GRADE ← (M1+M2+M3+M4)/4 Step 3: if (GRADE < 50) then Print “FAIL” else Print “PASS” endif
  • 8. The Flowchart  (Dictionary) A schematic representation of a sequence of operations, as in a manufacturing process or computer program.  (Technical) A graphical representation of the sequence of operations in an information system or program. Information system flowcharts show how data flows from source documents through the computer to final distribution to users. Program flowcharts show the sequence of instructions in a single program or subroutine. Different symbols are used to draw each type of flowchart.
  • 9. The Flowchart A Flowchart shows logic of an algorithm emphasizes individual steps and their interconnections e.g. control flow from one action to the next
  • 11. Example PRINT “PASS” Step 1: Input M1,M2,M3,M4 Step 2: GRADE ← (M1+M2+M3+M4)/4 Step 3: if (GRADE <50) then Print “FAIL” else Print “PASS” endif START Input M1,M2,M3,M4 GRADE←(M1+M2+M3+M4)/4 IS GRADE<50 PRINT “FAIL” STOP YN
  • 12. Example 2  Write an algorithm and draw a flowchart to convert the length in feet to centimeter. Pseudocode:  Input the length in feet (Lft)  Calculate the length in cm (Lcm) by multiplying LFT with 30  Print length in cm (LCM)
  • 13. Example 2 Algorithm  Step 1: Input Lft  Step 2: Lcm ← Lft x 30  Step 3: Print Lcm START Input Lft Lcm ← Lft x 30 Print Lcm STOP Flowchart
  • 14. Example 3 Write an algorithm and draw a flowchart that will read the two sides of a rectangle and calculate its area. Pseudocode  Input the width (W) and Length (L) of a rectangle  Calculate the area (A) by multiplying L with W  Print A
  • 15. Example 3 Algorithm  Step 1: Input W,L  Step 2: A ← L x W  Step 3: Print A START Input W, L A ← L x W Print A STOP
  • 16. Example 4  Write an algorithm and draw a flowchart that will calculate the roots of a quadratic equation  Hint: d = sqrt ( ), and the roots are: x1 = (–b + d)/2a and x2 = (–b – d)/2a 2 0ax bx c+ + = 2 4b ac−
  • 17. Example 4 Pseudocode:  Input the coefficients (a, b, c) of the quadratic equation  Calculate d  Calculate x1  Calculate x2  Print x1 and x2
  • 18. Example 4  Algorithm:  Step 1: Input a, b, c  Step 2: d ← sqrt ( )  Step 3: x1 ← (–b + d) / (2 x a)  Step 4: x2 ← (–b – d) / (2 x a)  Step 5: Print x1, x2 START Input a, b, c d ← sqrt(b x b – 4 x a x c) Print x1 ,x2 STOP x1 ←(–b + d) / (2 x a) X2 ← (–b – d) / (2 x a) 4b b a c× − × ×
  • 19. DECISION STRUCTURES  The expression A>B is a logical expression  it describes a condition we want to test  if A>B is true (if A is greater than B) we take the action on left  print the value of A  if A>B is false (if A is not greater than B) we take the action on right  print the value of B
  • 21. IF–THEN–ELSE STRUCTURE  The structure is as follows If condition then true alternative else false alternative endif
  • 22. IF–THEN–ELSE STRUCTURE  The algorithm for the flowchart is as follows: If A>B then print A else print B endif is A>B Print BPrint A Y N
  • 23. Relational Operators Relational Operators Operator Description > Greater than < Less than = Equal to ≥ Greater than or equal to ≤ Less than or equal to ≠ Not equal to
  • 24. Example 5  Write an algorithm that reads two values, determines the largest value and prints the largest value with an identifying message. ALGORITHM Step 1: Input VALUE1, VALUE2 Step 2: if (VALUE1 > VALUE2) then MAX ← VALUE1 else MAX ← VALUE2 endif Step 3: Print “The largest value is”, MAX
  • 25. Example 5 MAX ← VALUE1 Print “The largest value is”, MAX STOP Y N START Input VALUE1,VALUE2 MAX ← VALUE2 is VALUE1>VALUE2
  • 26. NESTED IFS  One of the alternatives within an IF– THEN–ELSE statement may involve further IF–THEN–ELSE statement
  • 27. Example 6  Write an algorithm that reads three numbers and prints the value of the largest number.
  • 28. Example 6 Step 1: Input N1, N2, N3 Step 2: if (N1>N2) then if (N1>N3) then MAX ← N1 [N1>N2, N1>N3] else MAX ← N3 [N3>N1>N2] endif else if (N2>N3) then MAX ← N2 [N2>N1, N2>N3] else MAX ← N3 [N3>N2>N1] endif endif Step 3: Print “The largest number is”, MAX
  • 29. Example 7  Write and algorithm and draw a flowchart to a) read an employee name (NAME), overtime hours worked (OVERTIME), hours absent (ABSENT) and b) determine the bonus payment (PAYMENT).
  • 30. Example 7 Bonus Schedule OVERTIME – (2/3)*ABSENT Bonus Paid >40 hours >30 but ≤ 40 hours >20 but ≤ 30 hours >10 but ≤ 20 hours ≤ 10 hours $50 $40 $30 $20 $10
  • 31. Step 1: Input NAME,OVERTIME,ABSENT Step 2: if (OVERTIME–(2/3)*ABSENT > 40) then PAYMENT ← 50 else if (OVERTIME–(2/3)*ABSENT > 30) then PAYMENT ← 40 else if (OVERTIME–(2/3)*ABSENT > 20) then PAYMENT ← 30 else if (OVERTIME–(2/3)*ABSENT > 10) then PAYMENT ←20 else PAYMENT ← 10 endif Step 3: Print “Bonus for”, NAME “is $”, PAYMENT
  • 32. Conclusion  An algorithm is an effective method that can be expressed within a finite amount of space and timeand in a well-defined formal language for calculating a function. Starting from an initial state and initial input (perhaps empty, the instructions describe a computation that, when executed, proceeds through a finite number of well-defined successive states, eventually producing "output"] and terminating at a final ending state. The transition from one state to the next is not necessarily deterministic; some algorithms, known as randomized algorithms, incorporate random input.
  • 33. Conclusion Flowcharts are used in designing and documenting simple processes or programs. Like other types of diagrams, they help visualize what is going on and thereby help understand a process, and perhaps also find flaws, bottlenecks, and other less-obvious features within it.