Structured%20Programming - PowerPoint PPT Presentation

About This Presentation
Title:

Structured%20Programming

Description:

... a composite object on the next lowest level of greater detail: as a result, the ... at each level decreases by an order of magnitude when we shift our attention ... – PowerPoint PPT presentation

Number of Views:16
Avg rating:3.0/5.0
Slides: 10
Provided by: bilke
Category:

less

Transcript and Presenter's Notes

Title: Structured%20Programming


1
Structured Programming
  • structured programming A technique for
    organizing and coding computer programs in which
    a hierarchy of modules is used, each having a
    single entry and a single exit point, and in
    which control is passed downward through the
    structure without unconditional branches to
    higher levels of the structure. Three types of
    control flow are used sequential, test, and
    iteration.

2
Advantages of Structured Programming
  • Easy to writeModular design increases the
    programmer's productivity by allowing them to
    look at the big picture first and focus on
    details later.Several Programmers can work on a
    single, large program, each working on a
    different moduleStudies show structured
    programs take less time to write than standard
    programs.Procedures written for one program can
    be reused in other programs requiring the same
    task. A procedure that can be used in many
    programs is said to be reusable

3
  • Easy to debugSince each procedure is specialized
    to perform just one task, a procedure can be
    checked individually. Older unstructured programs
    consist of a sequence of instructions that are
    not grouped for specific tasks. The logic of such
    programs is cluttered with details and therefore
    difficult to follow.Easy to UnderstandThe
    relationship between the procedures shows the
    modular design of the program.Meaningful
    procedure names and clear documentation identify
    the task performed by each moduleMeaningful
    variable names help the programmer identify the
    purpose of each variable.Easy to ChangeSince a
    correctly written structured program is
    self-documenting, it can be easily understood by
    another programmer.

4
Top Down Design
  • Top Down Design is a method of designing
    something that starts with the complete item then
    breaks it down into smaller and smaller
    components. In programming it means breaking a
    difficult task down (divide and conquer) and
    solving pieces independently until every step can
    easily be implemented (successive refinement).

5
Dog House Example
  • 1. Floor or Base
  • 2. Walls
  • 2.1 Back Wall
  • 2.1.1 Top section2.1.2 Lower section
  • 2.2. Left Wall2.3 Right Wall2.4 Front Wall
  • 2.4.1 Top section2.4.2 Door section
  • 3. Roof
  • 3.1 Left Side3.2 Right Side

6
  • Prepare all sections as described below then join
    sections using nails and glue as specified.
  • 1. Floor or Base - cut to specified size and
    smooth edges
  • 2. Walls
  • 2.1 Back Wall
  • 2.1.1 Top section - cut triangular shape2.1.2
    Lower section - cut square shape and glue and
    staple to upper part of wall
  • 2.2. Left Wall - cut to specified dimensions2.3
    Right Wall - cut to specified dimensions2.4
    Front Wall
  • 2.4.1 Top section - cut triangular piece to
    specified dimensions2.4.2 Door section - use
    jigsaw to cut U shape for the door in square
    shape, staple and glue to top section
  • 3. Roof
  • 3.1 Left Side - cut to specified dimensions3.2
    Right Side - cut to specified dimensions

7
(No Transcript)
8
  • Hierarchical systems seem to have a property that
    something considered as an undivided entity on
    one level is considered as a composite object on
    the next lowest level of greater detail as a
    result, the natural grain of space or time that
    is applicable at each level decreases by an order
    of magnitude when we shift our attention from one
    level to the next lower one. We understand walls
    in terms of bricks, bricks in terms of crystals,
    crystals in terms of molecules, etc.-----E.
    Dijkstra

9
  • The Fundamental Principle of Structured
    Programming is that at all times and under all
    circumstances, the programmer must keep the
    program within his intellectual grasp. The
    well-known methods for achieving this can be
    briefly summarized as follows 1) top-down design
    and construction, 2) limited control structures,
    and 3) limited scope of data structures.-----Tom
    Harbron
  • A study of program structure has revealed that
    programs can differ tremendously in their
    intellectual manageability. A number of rules
    have been discovered, violations of which will
    either seriously impair or totally destroy the
    intellectual manageability of the program....I
    now suggest that we confine ourselves to the
    design and implementation of intellectually
    manageable programs.-----E. Dijkstra
Write a Comment
User Comments (0)
About PowerShow.com