EasyManua.ls Logo

Radio Shack TRS-80 - Page 130

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...
. . .
then RUN.
Check
your
answers
against the
2
dimensional matrix
chart we
gave you
earlier.
They
should
agree.
Let your
imagination
go. Can you
envision
entire charts
and tables stored
in this
manner?
Entire
inventory
lists?
How about
trying to find
a car
which
has a certain
size
engine
AND
a
certain
color?
Hmmm.
We will
come
back
to the
Logic
needed for
that last
one
in a later
chapter.
EXERCISE
21-1
: Assume
that
your
inventory of
10
cars
includes
3
different
body
styles,
coded
10,
20
and
30,
as
follows:
LICENSE
#
BODY
STYLE
1
20
2
20
3
10
4 20
5
30
6
20
7
30
8
10
9
20
10
20
Modify
the resident
program to
print the body
style
information
along
with
the rest
when
the car is
identified by
license
number.
m
A
Smith
& Wesson
Beats 4
Aces
If we
want
to
create
a
computerized card
game (they
make good
examples to
show
so
many
things),
how
can we
set it up
so
we draw
the 52 or so
(watch
the dealer at
all times)
cards
in a
totally
random
way?
Answer:
Spin up
the
deck
into a
single-dimension
array,
pick
array
elements
using a
random
number
generator,
as
each
card
is
"drawn",
set its
array
128

Other manuals for Radio Shack TRS-80

Related product manuals