EasyManua.ls Logo

Radio Shack TRS-80

Radio Shack TRS-80
236 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter 21
Numeric Arrays
We
know that
we
have
the
26 letters of the
alphabet
available
to use as variables.
We've
also discovered that very few
of
our
programs have
required
anywhere
near
that many
variables. There are times, however,
when we
wish
to have
more
variables
available
some-
times
hundreds or
even
thousands
of them,
to
use
as names
for
many different
pieces of
data
we are storing
and want
to "retrieve"
easily.
The
way out of
this little dilemma
is
with
an array. Array is
just
another word
for
"lineup",
"arrangement"
or
"series
of things".
Let's
say we're talking about
a
collection,
arrangement
or lineup (array)
of
a
number
of autos, all of which
have
different license
plates
(address
numbers).
To be
specific,
we have
10
cars lined
up, as in an array.
They
are all the
same except
for
their engine size
and
each has a different
license
plate number.
Let's say the
license
plate
numbers are from
1 to
10,
and we want
to use
the Computer
to
quickly spit
out the engine
size when we identify
a car by license number. This
might
not seem like
a real heavyweight
problem
but,
as
before,
we discover the full
potential
of these things
by learning
them
little steps
at
a
time.
Numeric Amy?
. must
be
some
kind
of
new
Let's assume
the
license
number and engine sizes
are
as follows:
LICENSE #
1
2
3
4
5
6
7
8
9
10
ENGINE
(cubic
inches)
300
200
500
300
200
300
400
400
300
500
123

Other manuals for Radio Shack TRS-80

Related product manuals