title: Finding a cumulative frequency array
body: <p>This method converts a frequency array into a cumulative frequency array. 
  For example if the initial array was { 1, 2, 3, 4} calling the method should give you { 1, 3, 6, 10}  </p>
  
  <p>This is what Ive written: </p>
  
  <pre><code>public void cumulate(int[] a)
  {
     for (int i= 0; i &lt; a.length; i ++){
            a[i] = a[i-1] + a[i];
      }
  }
  </code></pre>
  
  <p>I'm certain its wrong, but I do need help with generating another set of codes. If anyone is able to assist me, that would be lovely! </p>