Chapter 23
Flowcharting
Most of the
programs we
wrote so
far were simple; but, they met fairly simple needs.
Suppose you
want to
write a program to play chess or bridge, evaluate complicated invest-
ment
alternatives,
keep
records for a bowling league or a small business,
or do
stress calcula-
tions for a new
building? How
would you
go
about writing
a
complex program like that?
Answer:
You break
down
the big program into a series of
smaller programs.
This is called
Modular
Programming
and the individual programs are called
Modules.
But how are the
modules related
—
and
how
do you write them anyway?
One way to
plan a program is to
make
a picture displaying its logic. Remember, a
picture is
worth a thousand words
(or
is it the other way around?). The picture that pro-
grammers use is called a flowchart.
Flowcharts are so widely used that programmers have
devised standard
symbols. There are many
specialized symbols in
use, but we will examine
only the most
common
ones.
BEGIN or END
PROCESSING
BLOCK
(encloses
something
the
computer
does without
making any
decisions)
DECISION
DIAMOND
(it
branches
off
in
dif-
ferent
directions,
depend-
ing on
the decision it
makes.)
Module is just a 75-cent word for
-
ll
s««iao)i-
or
"building
block"
...
141