Exercises - Using Compound Variables and Stems
- After these assignment instructions, what do the following
SAY instructions produce?
a = 3 /* assigns '3' to variable 'A' */ d = 4 /* '4' to 'D' */ c = 'last' /* 'last' to 'C' */ a.d = 2 /* '2' to 'A.4' */ a.c = 5 /* '5' to 'A.last' */ z.a.d = 'cv3d' /* 'cv3d' to 'Z.3.4' */- SAY a
- SAY D
- SAY c
- SAY a.a
- SAY A.D
- SAY d.c
- SAY c.a
- SAY a.first
- SAY z.a.4
- After these assignment instructions, what output do the
SAY instructions produce?
hole.1 = 'full' hole. = 'empty' hole.s = 'full'- SAY hole.1
- SAY hole.s
- SAY hole.mouse
ANSWERS
-
- 3
- 4
- last
- A.3
- 2
- D.last
- C.3
- A.FIRST
- cv3d
-
- empty
- full
- empty