title: returning a count of the number of slots in the array that contain a value that is equal to the index of the slot
body: <p>I am trying to write a program that will return the number of slots in the array that contain a value that is equal to the index of the slot, after random numbers are generated, then prints each element of the array on a separate line with an asterix. (Suppose to look like this:)</p>
  
  <pre><code>Enter the array size: 4
  a[0] = 2
  a[1] = 1 *
  a[2] = 0
  a[3] = 2
  There are 1 slots where the index is the same as the value.
  </code></pre>
  
  <p>But I am failing miserably, any nudge in the right direction would be appreciated. This is what I have so far:</p>
  
  <pre><code>import java.util.Scanner;
  
  public class RandomArray {
  
  public static void main(String[] args) {
      Scanner in = new Scanner(System.in);
  
              int i;
      System.out.println("Enter the array size: ");
              i = in.nextInt();
  
  }
  
  /**
   * Fills an array with random integers in the range from zero to one less
   * than the array size.
   * 
   * @param array
   *            the array to fill with random integers
   */
  public static void fillArrayWithRandomInts(int array[]) {
      java.util.Random random = new java.util.Random(13);
      for (int i = 0; i &lt; array.length; ++i)
          array[i] = (int) (random.nextDouble() * array.length);
  }
  
  public static int countSlotsWithIndexEqualToValue(int array[]) {
  
      int[] value = new int[13];
  
      for (int i = 0; i &lt; array.length; i++) {
  
          if (value[13] == array[13])
              ;
  
      }
      return value[13];
  
  }
  
  public static void printArray(int array[]) {
  
  }
  
  }
  </code></pre>