SlideShare ist ein Scribd-Unternehmen logo
1 von 14
ALGORITHMS
    &
FLOWCHARTS
      Ashwin Anand V
Algorithm
An Algorithm is just a detailed sequence of simple
steps that are needed to solve a problem


Flowchart
A Flowchart is the graphical representation of
an Algorithm.
Steps to create an algorithm
• First produce a general algorithm

• Refine the algorithm successively to get step by step detailed
  algorithm that is very close to a computer language.

• Pseudo code is an artificial and informal language that helps
  programmers develop algorithms. Pseudo code is very similar
  to everyday English.
Example
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.
 Pseudo code:
 • 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”
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”
                   end
Flowchart Symbols
                         Basic
Name            Symbol      Use in Flowchart


Oval                        Denotes the beginning or end of the program




Parallelogram               Denotes an input operation




Rectangle                   Denotes a process to be carried out
                            e.g. addition, subtraction, division etc.




Diamond                     Denotes a decision (or branch) to be made.
                            The program should continue along one of
                            two routes. (e.g. IF/THEN/ELSE)




Hybrid                      Denotes an output operation




Flow line                   Denotes the direction of logic flow in the program
Example
                START
                                      Step 1:      Input
               Input
                                      M1,M2,M3,M4
            M1,M2,M3,M4
                                      Step 2:      GRADE
                                      (M1+M2+M3+M4)/4
   GRADE   (M1+M2+M3+M4)/4
                                      Step 3:      if (GRADE <50) then
                                                   Print “FAIL”
  N                          Y
                IS
             GRADE<50
                                              else
                                                   Print “PASS”
PRINT                        PRINT            end
“PASS”                       “FAIL”




               STOP
Example
• Write an algorithm that reads two values, determines the
  largest value and prints the largest value with an identifying
  message.

ALGORITHM

Step 1:        Input A,B
Step 2:        if (A> B) then
                       MAX A
               else
                       MAX B
               end
Step 3:        Print “The largest value is”, MAX
• 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
START



                       Input
                        A,B



          Y               is
                                        N
                         A>B




MAX   A                          MAX        B




                     Print
          “The largest value is”, MAX



                     STOP
Thank you
Disclaimer: This presentation is prepared by trainees of baabtra as
a part of mentoring program. This is not official document of
baabtra – Mentoring Partner
baabtra – Mentoring Partner is the mentoring division of baabte System Technologies Pvt. Ltd.
Contact Us

Weitere ähnliche Inhalte

Was ist angesagt?

2016 Excel/VBA Notes
2016 Excel/VBA Notes2016 Excel/VBA Notes
2016 Excel/VBA NotesYang Ye
 
Programming fundamentals lecture 2 of c
Programming fundamentals lecture 2 of cProgramming fundamentals lecture 2 of c
Programming fundamentals lecture 2 of cRaja Hamid
 
Online Advance Excel & VBA Training in India
 Online Advance Excel & VBA Training in India Online Advance Excel & VBA Training in India
Online Advance Excel & VBA Training in Indiaibinstitute0
 
Csc 130 class 2 problem analysis and flow charts(2)
Csc 130 class 2   problem analysis and flow charts(2)Csc 130 class 2   problem analysis and flow charts(2)
Csc 130 class 2 problem analysis and flow charts(2)Puneet narula
 
Chapter 6 algorithms and flow charts
Chapter 6  algorithms and flow chartsChapter 6  algorithms and flow charts
Chapter 6 algorithms and flow chartsPraveen M Jigajinni
 
E learning excel vba programming lesson 3
E learning excel vba programming  lesson 3E learning excel vba programming  lesson 3
E learning excel vba programming lesson 3Vijay Perepa
 
Ite295 excel if-stmtdsmithfinal
Ite295 excel if-stmtdsmithfinalIte295 excel if-stmtdsmithfinal
Ite295 excel if-stmtdsmithfinaldpsmith-dcc
 
Intro to Excel VBA Programming
Intro to Excel VBA ProgrammingIntro to Excel VBA Programming
Intro to Excel VBA Programmingiveytechnologyclub
 
E learning excel vba programming lesson 4
E learning excel vba programming  lesson 4E learning excel vba programming  lesson 4
E learning excel vba programming lesson 4Vijay Perepa
 
AVB201.1 MS Access VBA Module 1
AVB201.1 MS Access VBA Module 1AVB201.1 MS Access VBA Module 1
AVB201.1 MS Access VBA Module 1guest38bf
 
Programming flowcharts for C Language
Programming flowcharts for C LanguageProgramming flowcharts for C Language
Programming flowcharts for C LanguageAryan Ajmer
 
2.3 Apply the different types of algorithm to solve problem
2.3 Apply the different types of algorithm to solve problem2.3 Apply the different types of algorithm to solve problem
2.3 Apply the different types of algorithm to solve problemFrankie Jones
 
Flowcharts and algorithms
Flowcharts and algorithmsFlowcharts and algorithms
Flowcharts and algorithmsStudent
 

Was ist angesagt? (20)

2016 Excel/VBA Notes
2016 Excel/VBA Notes2016 Excel/VBA Notes
2016 Excel/VBA Notes
 
Programming fundamentals lecture 2 of c
Programming fundamentals lecture 2 of cProgramming fundamentals lecture 2 of c
Programming fundamentals lecture 2 of c
 
Online Advance Excel & VBA Training in India
 Online Advance Excel & VBA Training in India Online Advance Excel & VBA Training in India
Online Advance Excel & VBA Training in India
 
Csc 130 class 2 problem analysis and flow charts(2)
Csc 130 class 2   problem analysis and flow charts(2)Csc 130 class 2   problem analysis and flow charts(2)
Csc 130 class 2 problem analysis and flow charts(2)
 
Chapter 6 algorithms and flow charts
Chapter 6  algorithms and flow chartsChapter 6  algorithms and flow charts
Chapter 6 algorithms and flow charts
 
Pseudocode
PseudocodePseudocode
Pseudocode
 
E learning excel vba programming lesson 3
E learning excel vba programming  lesson 3E learning excel vba programming  lesson 3
E learning excel vba programming lesson 3
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchart
 
Ite295 excel if-stmtdsmithfinal
Ite295 excel if-stmtdsmithfinalIte295 excel if-stmtdsmithfinal
Ite295 excel if-stmtdsmithfinal
 
Intro to Excel VBA Programming
Intro to Excel VBA ProgrammingIntro to Excel VBA Programming
Intro to Excel VBA Programming
 
E learning excel vba programming lesson 4
E learning excel vba programming  lesson 4E learning excel vba programming  lesson 4
E learning excel vba programming lesson 4
 
Ma3696 Lecture 3
Ma3696 Lecture 3Ma3696 Lecture 3
Ma3696 Lecture 3
 
Vba part 1
Vba part 1Vba part 1
Vba part 1
 
Algorithmsandflowcharts1
Algorithmsandflowcharts1Algorithmsandflowcharts1
Algorithmsandflowcharts1
 
Flow charts
Flow chartsFlow charts
Flow charts
 
AVB201.1 MS Access VBA Module 1
AVB201.1 MS Access VBA Module 1AVB201.1 MS Access VBA Module 1
AVB201.1 MS Access VBA Module 1
 
Programming flowcharts for C Language
Programming flowcharts for C LanguageProgramming flowcharts for C Language
Programming flowcharts for C Language
 
Decision control
Decision controlDecision control
Decision control
 
2.3 Apply the different types of algorithm to solve problem
2.3 Apply the different types of algorithm to solve problem2.3 Apply the different types of algorithm to solve problem
2.3 Apply the different types of algorithm to solve problem
 
Flowcharts and algorithms
Flowcharts and algorithmsFlowcharts and algorithms
Flowcharts and algorithms
 

Ähnlich wie Algorithms&flowcharts

Programming fundamentals lecture 4
Programming fundamentals lecture 4Programming fundamentals lecture 4
Programming fundamentals lecture 4Raja Hamid
 
Algorithms and Flowcharts
Algorithms and FlowchartsAlgorithms and Flowcharts
Algorithms and FlowchartsDeva Singh
 
01 Algorithms And Flowcharts.ppt
01 Algorithms And Flowcharts.ppt01 Algorithms And Flowcharts.ppt
01 Algorithms And Flowcharts.pptFerdieBalang
 
256958.ppt
256958.ppt256958.ppt
256958.pptBimlesh7
 
Algorithmsandflowcharts1
Algorithmsandflowcharts1Algorithmsandflowcharts1
Algorithmsandflowcharts1luhkahreth
 
Algorithmsandflowcharts1
Algorithmsandflowcharts1Algorithmsandflowcharts1
Algorithmsandflowcharts1Jesuraj Love
 
Algorithms and flowcharts1
Algorithms and flowcharts1Algorithms and flowcharts1
Algorithms and flowcharts1Lincoln School
 
Algorithms and flowcharts
Algorithms and flowchartsAlgorithms and flowcharts
Algorithms and flowchartsSamuel Igbanogu
 
Algorithms and flowcharts
Algorithms and flowchartsAlgorithms and flowcharts
Algorithms and flowchartskhair20
 
algorithms and flow chart overview.pdf
algorithms and flow chart overview.pdfalgorithms and flow chart overview.pdf
algorithms and flow chart overview.pdfAmanPratik11
 
Basic Slides on Algorithms and Flowcharts
Basic Slides on Algorithms and FlowchartsBasic Slides on Algorithms and Flowcharts
Basic Slides on Algorithms and Flowchartsmoazwinner
 
Lecture1-Algorithms-and-Flowcharts-ppt.ppt
Lecture1-Algorithms-and-Flowcharts-ppt.pptLecture1-Algorithms-and-Flowcharts-ppt.ppt
Lecture1-Algorithms-and-Flowcharts-ppt.pptReshuReshma8
 
Computer programming:Know How to Flowchart
Computer  programming:Know How to FlowchartComputer  programming:Know How to Flowchart
Computer programming:Know How to FlowchartAngelo Tomboc
 

Ähnlich wie Algorithms&flowcharts (20)

Programming fundamentals lecture 4
Programming fundamentals lecture 4Programming fundamentals lecture 4
Programming fundamentals lecture 4
 
Algorithms and Flowcharts
Algorithms and FlowchartsAlgorithms and Flowcharts
Algorithms and Flowcharts
 
01 Algorithms And Flowcharts.ppt
01 Algorithms And Flowcharts.ppt01 Algorithms And Flowcharts.ppt
01 Algorithms And Flowcharts.ppt
 
256958.ppt
256958.ppt256958.ppt
256958.ppt
 
Algorithm & flow chart
Algorithm & flow chartAlgorithm & flow chart
Algorithm & flow chart
 
Algorithmsandflowcharts1
Algorithmsandflowcharts1Algorithmsandflowcharts1
Algorithmsandflowcharts1
 
Algorithmsandflowcharts1
Algorithmsandflowcharts1Algorithmsandflowcharts1
Algorithmsandflowcharts1
 
Algorithmsandflowcharts1
Algorithmsandflowcharts1Algorithmsandflowcharts1
Algorithmsandflowcharts1
 
Algorithms and flowcharts1
Algorithms and flowcharts1Algorithms and flowcharts1
Algorithms and flowcharts1
 
Algorithms and flowcharts
Algorithms and flowchartsAlgorithms and flowcharts
Algorithms and flowcharts
 
Presentation
PresentationPresentation
Presentation
 
Flowcharts
FlowchartsFlowcharts
Flowcharts
 
Presentation
PresentationPresentation
Presentation
 
flowcharts
flowchartsflowcharts
flowcharts
 
Algorithms and flowcharts
Algorithms and flowchartsAlgorithms and flowcharts
Algorithms and flowcharts
 
algorithms and flow chart overview.pdf
algorithms and flow chart overview.pdfalgorithms and flow chart overview.pdf
algorithms and flow chart overview.pdf
 
Algorithms and Flowchart.ppt
Algorithms and Flowchart.pptAlgorithms and Flowchart.ppt
Algorithms and Flowchart.ppt
 
Basic Slides on Algorithms and Flowcharts
Basic Slides on Algorithms and FlowchartsBasic Slides on Algorithms and Flowcharts
Basic Slides on Algorithms and Flowcharts
 
Lecture1-Algorithms-and-Flowcharts-ppt.ppt
Lecture1-Algorithms-and-Flowcharts-ppt.pptLecture1-Algorithms-and-Flowcharts-ppt.ppt
Lecture1-Algorithms-and-Flowcharts-ppt.ppt
 
Computer programming:Know How to Flowchart
Computer  programming:Know How to FlowchartComputer  programming:Know How to Flowchart
Computer programming:Know How to Flowchart
 

Mehr von baabtra.com - No. 1 supplier of quality freshers

Mehr von baabtra.com - No. 1 supplier of quality freshers (20)

Agile methodology and scrum development
Agile methodology and scrum developmentAgile methodology and scrum development
Agile methodology and scrum development
 
Best coding practices
Best coding practicesBest coding practices
Best coding practices
 
Core java - baabtra
Core java - baabtraCore java - baabtra
Core java - baabtra
 
Acquiring new skills what you should know
Acquiring new skills   what you should knowAcquiring new skills   what you should know
Acquiring new skills what you should know
 
Baabtra.com programming at school
Baabtra.com programming at schoolBaabtra.com programming at school
Baabtra.com programming at school
 
99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love 99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love
 
Php sessions & cookies
Php sessions & cookiesPhp sessions & cookies
Php sessions & cookies
 
Php database connectivity
Php database connectivityPhp database connectivity
Php database connectivity
 
Chapter 6 database normalisation
Chapter 6  database normalisationChapter 6  database normalisation
Chapter 6 database normalisation
 
Chapter 5 transactions and dcl statements
Chapter 5  transactions and dcl statementsChapter 5  transactions and dcl statements
Chapter 5 transactions and dcl statements
 
Chapter 4 functions, views, indexing
Chapter 4  functions, views, indexingChapter 4  functions, views, indexing
Chapter 4 functions, views, indexing
 
Chapter 3 stored procedures
Chapter 3 stored proceduresChapter 3 stored procedures
Chapter 3 stored procedures
 
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
Chapter 2  grouping,scalar and aggergate functions,joins   inner join,outer joinChapter 2  grouping,scalar and aggergate functions,joins   inner join,outer join
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Microsoft holo lens
Microsoft holo lensMicrosoft holo lens
Microsoft holo lens
 
Blue brain
Blue brainBlue brain
Blue brain
 
5g
5g5g
5g
 
Aptitude skills baabtra
Aptitude skills baabtraAptitude skills baabtra
Aptitude skills baabtra
 
Gd baabtra
Gd baabtraGd baabtra
Gd baabtra
 

Algorithms&flowcharts

  • 1.
  • 2. ALGORITHMS & FLOWCHARTS Ashwin Anand V
  • 3. Algorithm An Algorithm is just a detailed sequence of simple steps that are needed to solve a problem Flowchart A Flowchart is the graphical representation of an Algorithm.
  • 4. Steps to create an algorithm • First produce a general algorithm • Refine the algorithm successively to get step by step detailed algorithm that is very close to a computer language. • Pseudo code is an artificial and informal language that helps programmers develop algorithms. Pseudo code is very similar to everyday English.
  • 5. Example 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. Pseudo code: • 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”
  • 6. 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” end
  • 7. Flowchart Symbols Basic Name Symbol Use in Flowchart Oval Denotes the beginning or end of the program Parallelogram Denotes an input operation Rectangle Denotes a process to be carried out e.g. addition, subtraction, division etc. Diamond Denotes a decision (or branch) to be made. The program should continue along one of two routes. (e.g. IF/THEN/ELSE) Hybrid Denotes an output operation Flow line Denotes the direction of logic flow in the program
  • 8. Example START Step 1: Input Input M1,M2,M3,M4 M1,M2,M3,M4 Step 2: GRADE (M1+M2+M3+M4)/4 GRADE (M1+M2+M3+M4)/4 Step 3: if (GRADE <50) then Print “FAIL” N Y IS GRADE<50 else Print “PASS” PRINT PRINT end “PASS” “FAIL” STOP
  • 9. Example • Write an algorithm that reads two values, determines the largest value and prints the largest value with an identifying message. ALGORITHM Step 1: Input A,B Step 2: if (A> B) then MAX A else MAX B end Step 3: Print “The largest value is”, MAX
  • 10. • 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
  • 11. START Input A,B Y is N A>B MAX A MAX B Print “The largest value is”, MAX STOP
  • 13. Disclaimer: This presentation is prepared by trainees of baabtra as a part of mentoring program. This is not official document of baabtra – Mentoring Partner baabtra – Mentoring Partner is the mentoring division of baabte System Technologies Pvt. Ltd.