SlideServe
Menu
Préférences
© SlideServe · v2026

Flowcharts

liam avatar
11 diapositives · 514 Views · Sep 06, 2011

Flowcharts. adapted from A Visual Tool for Logic Design and Program Planning, by Dr. Donald Bell, Cal Poly, 1999 updated April, 2010. What Is a Flowchart?. Diagram with lines (arrows) and symbols to show how something works can show how code works in a program

Flowcharts - slide 1
01 / 11Flowcharts
1 / 17

Télécharger la présentation

Flowcharts
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Flowcharts adapted from A Visual Tool for Logic Design and Program Planning, by Dr. Donald Bell, Cal Poly, 1999 updated April, 2010

  2. What Is a Flowchart? • Diagram with lines (arrows) and symbols to show how something works • can show how code works in a program • definition and symbols (programming) • can also be used to help understand other processes • criminal justice system flowchart (symbols somewhat different than for programming)

  3. Flowcharts • Reasons for using flowcharts • similar to reasons for using pseudocode • Special symbols used in flowcharts • Rules for Successive Refinement

  4. Purpose of Flowcharts • To plan your logic prior to writing your program • Can be very helpful when you have complex conditional logic (the graphics help visualize the logic flow) • Assists in applying "successive refinement" ("top down" analysis) • Can also be used to document your logic • not used as much with object oriented code

  5. Successive Refinement • Equally applicable whether you use flowcharting or pseudocode • Start at the very "top level" • a one line statement of your program's purpose • break it down by stages into greater and greater levels of detail • Successive refinement stops when there is enough detail to write the program • Each flowchart symbol is a basic building block (like Tinker Toys orLego blocks) • these are assembled into complex structures • assembled in specific ways

  6. Flowcharting Symbols • Like pseudocode there are no fixed "standards", but there are conventions • Flowcharts use ovals, rectangles and diamonds • ovals start and end the logic flow • rectangles are for imperative statements • diamonds are for decisions • Some people use other symbols such as parallelograms for input and output, etc.

  7. Rules for Applying Successive Refinement Using Flowcharts • Can replace one rectangular block with several more detailed ones • Can replace a rectangular block with one including logic or iteration (looping) • Each block has one entry point, and one exit point (very important!) • but different statements can enter it there • Flow does not terminate until you get to a stop or end symbol

  8. Rules for Applying Successive Refinement Using Flowcharts - 2 • Start with a simple chart that summarizes the whole system (high level view) • use separate symbols for each major aspect, e.g., input, processing, output • Decompose each major aspect into a more detailed flow chart • e.g., input could decompose into: prompt user, read input, check input, if wrong give error message and prompt for good data

  9. Flowcharts & OO Programs • Flowcharts use a sequential logic • top to bottom • OO programming is often "event driven" • objects fire methods in response to messages • However flowcharting is suitable for developing code within methods

  10. UML Diagrams • Identify tasks (use cases) • Identify which object should handle a task • Identify messages sent between objects • Draw objects and messages into a diagram • example of a "use case diagram (which shows a class, properties, methods)

  11. Review • Draw flowcharts for sequence, selection and iteration control structures • Draw a flowchart for code that counts the number of students with GPAs of 3.0 or higher and then prints the total • Will need to use sequence, selection and iteration