title: How to set up this 2D Boolean Array?
body: <p>so I have to do this problem, but these arrays are confusing me because I’m not sure how to combine a boolean with arrays and then have them properly organized. I know this is a completely incorrect code, but I really don't know what to do. These are the instructions:</p>
  
  <p><strong>Declare a 2D boolean array of size 5 and 10</strong></p>
  
  <p><strong>Fill out the array with true if a random value is 0.5 else false</strong></p>
  
  <p><strong>Print number of false in the array</strong></p>
  
  <p><strong>Print the array one line per row</strong></p>
  
  <p><strong>Print the array indexes one line per row</strong></p>
  
  <p><strong>Print only the index of the cells with true value</strong></p>
  
  <pre><code>  public class DoubleArray {
  
    public static void main(String [] args) {
  
  
    double [][] a = new double[10][15];
    int zeroCount = 0;               
    for (int i= 0; i&lt;a.length;i++)
     {                               
        if (Math.random()&gt;0.5)  {
  
             System.out.println("1" + "\t" + "1");
         }
      else 
      {
  
          zeroCount++;    // increment
          System.out.println("0" + "\t" + "0");
  
      }
  }
  System.out.println("Number of zeros is " + zeroCount);  
  
  }
  }
  </code></pre>