title: passing array values from methods and writing to text output file
body: <p>So i have been slogging threw this project all day and at this point i have no idea where to go.  The project is to create an array of 1000 random integers that are assigned values of 1-10. Next, create an array that stores the frequency of the integers generated. Next, calculate the average of the integers in an array.  And finally, to output all those values to a text file.  I have watched countless videos and am utterly lost at this point.  the examples in the text are for one main method that outputs the text.  I am not sure if i am supposed to put the text file commands into the main method or if i should develop a separate method to handle the text file output.  If so, i am not sure if i pass the arrays from my other methods into a new textFile method or what have you...</p>
  
  <p>Last week was my first time working with multiple methods and this week is my first work with arrays so any guidance here would be greatly appreciated.</p>
  
  <p>This is my code so far.</p>
  
  <pre><code> package randomintegers;
   import java.util.*;
   import java.io.*;
  
  
   public class RandomIntegers {
  
  /**
   * @param args the command line arguments
   */
  public static void main(String[] args) {
  
      int randomNumbers[] = new int [1000];
      int i;
      for (i=0;i&lt;randomNumbers.length;++i){
      randomNumbers[i] = 1 + (int)(Math.random() * 10);
  
      }
      calcFrequency(randomNumbers);
      calcAverage(randomNumbers);
  }
  
  
  public static void calcFrequency(int[] inputArray){
      int[] freq=new int[10];
      int i;
      for (i=0;i&lt;inputArray.length;++i){
          ++freq[inputArray[i]-1];    
      }
  
      //System.out.println(inputArray);
      //System.out.println( (inputArray[i] + 1) + " occured " + freq[i] + " times" );
      System.out.println(Arrays.toString(freq));    }
  
        public static double calcAverage(int[] randomNumbers)
     {
         int sum = 0;
         for(int i : randomNumbers) sum += i;
          return ((int) sum)/randomNumbers.length;
     }
  
         public static void textRead(int[] calcAverage int[] calcFrequency)throws FileNotFoundException;{
         Scanner input = new Scanner(new File("randomIntegers.txt"));
         int frequency = input.nextInt();
         int [] outputFreq = new int[10];
     }
  </code></pre>
  
  <p>}  </p>