flowcharts l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Flowcharts PowerPoint Presentation
Download Presentation
Flowcharts

Loading in 2 Seconds...

play fullscreen
1 / 11

Flowcharts - PowerPoint PPT Presentation


  • 241 Views
  • Uploaded 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

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
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
Flowcharts
  • Reasons for using flowcharts
    • similar to reasons for using pseudocode
  • Special symbols used in flowcharts
  • Rules for Successive Refinement
purpose of flowcharts
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
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
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
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
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
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
uml diagrams
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)
review
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