import java.util.Scanner;
public class  average_matrix
{    
    
   public static void main(String[] args) 
   {
   
      double[][] a = new double[10][10];
        
      for (int row = 0; row < a.length; row++) 
      {
         for (int column = 0; column < a[row].length; column++)
         {
            a[row][column] = (int)(Math.random() * 100);
         }
      }
   
   
        
      System.out.println("Matrix Average = " + arrayAverage(a));
       // System.out.println("arrayAverage= " + arrayAverage(b));
   
   }


/**
 * computes the average for an array of a double
 */
   public static double arrayAverage(double a[][]) {
   
      double sum = 0.0;
      int count = 0; 
   
      for (int i = 0; i < a.length; i++) {
         for (int j = 0; j < a[i].length; j++) {
            sum += a[i][j];
            count++;
         
         }
      
      }
   
      System.out.println("Calculating Double Array");
   
      return sum / count;
   }
}