•
1.
2
3
4.
5.
6.
•
7.
8.
9.
10
It
is
not
easy
to
think
of
many differenf variable names
for
sforing
fhe
data.
If
you
can think
of
enough
names,
everyone has
to
be
written
in
a LET statement or
a READ statement
if
you
do not
use
arrays.
A number, called
the
subscript,
is
part
of
an
array variable
name.
All
the
variables
in
an
array share one name but each
has
a different subscript
You
must declare'
an
array giving
its
Size
(dimension)
in
a
DIM
statement usually
placed near the beginning
of
a program before
the
declared array
is
used.
The
distinguishing number
of
an
array
variable
is
called
the
subscript
Houses
in
a
street
share the same
street
name but each
has
its
own
number
Beds
in
a hospital ward may share the name
of
the
ward but each bed may be
numbered
Cells
in
a prison block may have a common block name but a different
number.
Holes on a golf
course,
e.g.
the
fifth
hole
at
Royal
Blrkdale.
A FOR loop terminates when the process corresponding
to
the
last
value
of
the
loop variable has been completed.
A FOR loop's name
is
also the name
of
the
variable which controls
the
loop.
The two phrases
for
thiS
variable
are
loop variable' or control
variable:
The values
of
a loop variable may be used
as
subscripts for array variable
names.
Thus,
as
the loop proceeds, each array variable
is
'visited' once.
Both
FOR loops and REPeat loops:
a.
have
an
opening keyword:
REPeal,
FOR
b.
have a closing statement
END REPeal
name, END FOR name
c
have
a loop
name.
Only the FOR loop
has
ANSWERS
TO
SELF
TEST
ON
CHAPTER
6
This
test
is
more searching than
the
previous
ones.
15
or
16
is
excellent
Carryon
reading.
13
or
14
is
very good but think a bit more about some
of
the
ideas.
Look
at
programs
to
see how they work.
11
or
12
is
good but re-read some parts
of
chapter
SIX.
8.
to
10
is
fair but re-read some parts
of
chapter
six
and do
the
test
again.
Under
8.
You
should re-read chapter
six
carefully and
do
the
test
again.
•
d. a loop variable or control variable.
(four paints)
CHECK
YOUR
SCORE
12184
109