Structure
and IPO Charts
Design
Documentation
Structure chart
Graphical
representation of the modules (user-defined, not built-ins) to be
implemented
in a program, demonstrating in what order they will be called and which
functions call which other functions
IPO chart:
Input/Process/Output chart
Tabular
representation of the modules to explain the data communication between
modules
as well as the function of the module itself.
IPO Layout
4 columns: module
name, I, P, and O
Variable number of
rows: 1 header row followed by 1 row for each module in the design
VERY IMPORTANT:
Input and Output describe DATA. They do NOT describe input from
file/keyboard
or output to file/screen. Those tasks are part of a module's PROCESS
– what it
does.
Input data to a module
is data the module needs to accomplish its task. Sent from calling to
called
module.
Output data from a
module is data the module calculates or creates and sends back to the
calling
module.
Examples:
Specification:
create a program to read in the length and width of a rectangle from
the
keyboard, calculate the area and perimeter, and display the input and
calculations to screen.
Structure
chart
|
|
main |
|
|
|
|
|
|
|
| getInput |
|
calcAreaPerim |
|
displayReport |
main() will call getInput()
and wait for it to finish, then main() will call calcAreaPerim()
and wait for it, then it will call displayReport()
and
wait, then main() will finish.
IPO chart
|
Module
|
I
|
P
|
O
|
|
main
|
none
|
controls calling other
functions and data communication between them
|
completion status to OS
|
|
getInput
|
none
|
prompts the user for a
length and width, reads values from keyboard
|
length, width
|
|
calcAreaPerim
|
length, width
|
calculates area as
length * width and perim
as 2 * (length + width)
|
area, perim
|
|
displayReport
|
length, width, area, perim
|
displays the original
input as well as calculated values to screen
|
none
|
Notice that keyboard
input is part of the PROCESS of getInput
and screen
output is part of the PROCESS of displayReport.
No
data is sent to getInput,
then it prompts and reads,
and it sends the length and width back out to main. displayReport
accepts 4 pieces of input, displays
them to screen, and does not send any data back out to main. It does
not
calculate anything therefore does not send out any data.
This document is for
design purposes: to help figure out the problem and necessary structure
and
steps to solve each piece BEFORE implementation. Therefore there should
not be
any reference to actual C code in the document. No data types, no
variable
names, just abstract logical descriptions.