CS 2401 Quiz #5

Name: ____________________________________________________

Date: Tuesday, September 21, 2010.

1. Please answer the following questions about the reading assignment:

1a. An array has a fixed size: once the size is declared, it cannot be changed (True or False):

1b. A vector has a fixed size: once the size is declared, it cannot be changed (True or False):

1c. An enumerated type has a fixed size: once the number of elements of this type is declared, it cannot be changed (True or False):

2. Write a recursive program for printing the following pattern of n lines:

   *    *       *        *     ...
       * *     * *      * *
              * * *    * * *
                      * * * *

n = 1  n = 2  n = 3    n = 4
Start with an algorithm, then transform this algorithm into a code, and trace this code for n = 3, for which your program should print the following pattern:
                *
               * *
              * * *