/** An instance is a two-dimensional array */
public class RectArray {
   private int[] b;  // The elements of the two-dimensional array are 
                     // stored in b in row-major order
   private int rows; // Number of rows in the two-dimensional array 
   private int cols; // Number of columns in the two-dimensional array
   
   /** Constructor: an array with r rows and c cols */
   public RectArray(int r, int c) {
      rows= r;
      cols= c;
      b= new int[1]; // You have to fix this to give the right number of elements
   }
   
   /** = number of rows */
   public int getRows() {
      return rows;
   }
   
   /** = number of columns */
   public int getCols() {
      return cols;
   }
   
   /** = the element at row r column c. Precondition:
         0 <= r < getRows() and 0 <= c < getCols() */
   public int elementAt(int r, int c) {
      return b[0];  // You have to fix this
   }
   
   /** set the element at row r column c to v. Precondition:
        0 <= r < getRows() and 0 <= c < getCols() */
   public void setElementAt(int r, int c, int v) {
      b[0]= 1;     // You have to fix this
   }
}
