public class ArrayEx5
{
  public static void main(String[] args)
  {
    double[][] scores = {{95, 82, 13, 96},
      {51, 68, 63, 57}, {73, 71, 84, 78}, {50, 50, 50, 50},
      {99, 70, 32, 12}};
    double average;

    average = 0; // uh oh, wrong place, tricky error to spot!!
    // here's where we control looping column by column (quiz by quiz)
    for (int col = 0; col < scores[0].length; col++)
    {

      // and here's where we control looping through the rows
      // (i.e., students) within each column
      for (int row = 0; row < scores.length; row++)
      {
        average = average + scores[row][col];
      }
      average = average / scores.length;
      System.out.println("average of column " + col + " is " + average);
    }
  }
}
