EasyManua.ls Logo

Commodore 64 - Page 108

Commodore 64
176 pages
Print Icon
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...
A(3,4) = 255
i L COLUMN
ROW
~
1
2
3
4
255
If we assigned the value 255 to A(3,4), then 255 could be thought of
as
being placed in the 4th column of the 3rd row within the table.
Two-dimensional arrays behave according to the same rules that were
established for one-dimensional arrays:
They must be dimensioned:
Assignment of data:
Assign values to other variables:
PRINT
values:
DIM A(20,20)
A( I, 1) = 255
AB = A(l,1)
PRINT A(I, 1)
If two-dimensional arrays work like their smaller counterparts, what
additional capabilities will the expanded arrays handle?
Try this: can you think of a way using a two-dimensional array to
tabulate the results of a questionnaire for your club that involved four
questions and had up to three responses for each question? The prob-
lem could be represented like this:
CLUB QUESTIONNAIRE
Ql: ARE YOU IN FAVOR OF RESOLUTION #1?
01-YES 02-NO 03-UNDECIDED
. . . and so on.
101

Table of Contents

Other manuals for Commodore 64

Related product manuals