Flowcharts
Download
1 / 11

flowcharts - PowerPoint PPT Presentation


  • 233 Views
  • Updated On :

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

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'flowcharts' - liam


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Flowcharts l.jpg

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 l.jpg
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)


Flowcharts3 l.jpg
Flowcharts

  • Reasons for using flowcharts

    • similar to reasons for using pseudocode

  • Special symbols used in flowcharts

  • Rules for Successive Refinement


Purpose of flowcharts l.jpg
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


Successive refinement l.jpg
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


Flowcharting symbols l.jpg
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.


Rules for applying successive refinement using flowcharts l.jpg
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


Rules for applying successive refinement using flowcharts 2 l.jpg
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


Flowcharts oo programs l.jpg
Flowcharts & OO Programs 2

  • 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


Uml diagrams l.jpg
UML Diagrams 2

  • 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)


Review l.jpg
Review 2

  • 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


ad