Name: ____________________________________________________ Alpha: _____________________

Describe help received: _________________________________________________________________

  1. [20pts] Assume the following delcarations and fill in the table with either the type of the given expression, or "error" if appropriate.
    double x;
    string s;
    double *A;
    int **M;
    string **W;
    
    expressiontype
    x
    s
    A
    M
    W
    x[0]
    s[0]
    A[0]
    M[0]
    W[0]
    expressiontype
    x[0][0]
    s[0][0]
    A[0][0]
    M[0][0]
    W[0][0]
    x[0][0][0]
    s[0][0][0]
    A[0][0][0]
    M[0][0][0]
    W[0][0][0]
  2. [10Pts] Write the code that would define (that means declare, allocate, initialize, etc) the 2D array shown in the diagram below.
  3. [70Pts] Download the file letters.txt and the program hw.cpp, and compile and run it. Modify the program by pulling code out into functions in order to simplify it, but without changing the program's output. Your goal is to come up with the cleanest, simplest version of the program you can.
Turn in this sheet, along with a screenshot showing your program running, and a codeprint printout (in landscape please!) of your code.