Exercises - Using Compound Variables and Stems

  1. After these assignment instructions, what is displayed in the following SAY instructions?
    a = 3                              /* assigns '3' to variable 'A'  */
    b = 4                              /*         '4' to          'B'  */
    c = 'last'                         /*      'last' to          'C'  */
    a.b = 2                            /*         '2' to         'A.4' */
    a.c = 5                            /*         '5' to      'A.last' */
    x.a.b = 'cv3d'                     /*      'cv3d' to       'X.3.4' */
    1. SAY a
    2. SAY B
    3. SAY c
    4. SAY a.a
    5. SAY A.B
    6. SAY b.c
    7. SAY c.a
    8. SAY a.first
    9. SAY x.a.4
  2. After these assignment instructions, what is displayed?
    hole.1 = 'full'
    hole. = 'empty'
    hole.s = 'full'
    1. SAY hole.1
    2. SAY hole.s
    3. SAY hole.mouse
ANSWERS
    1. 3
    2. 4
    3. last
    4. A.3
    5. 2
    6. B.last
    7. C.3
    8. A.FIRST
    9. cv3d
    1. empty
    2. full
    3. empty