```
import java.io.*;
import java.util.Scanner;

public class Kazarian_ArrayProcessing
{

public static void main(String[] args) throws Exception
{   
    inputData();
    mean(data); 
    // I am trying to pass in an array since the mean method 
    // accepts an array in the parameters but I'm having trouble doing that 
    // since the array doesn't have a fixed value but instead pulls from a
    // specific file

    /*sum(data); 
    max(data); 
    min(data);*/

}

// checks if file exists and if it does it pulls in the values from the file and 
// puts them into an array called data
public static int[] inputData() throws Exception
{
    Scanner keyboard = new Scanner(System.in);
    System.out.println("Please enter a file name: ");
    String inputFile = keyboard.next();
    File file = new File(inputFile);

    if (!file.exists())
    {
        System.out.println("This file does not exist!");
        System.exit(0);
    }

    // do this stuff if file does exist

    Scanner readFrom = new Scanner(file);
    int numberOfElements = readFrom.nextInt();
    int [] data = new int[numberOfElements];

    for (int i = 0; i < data.length; i++)
    {   
        if (readFrom.hasNextInt())
        {
            int start = readFrom.nextInt();
            data[i] = start;
            //System.out.println(data[i]);
        }

    }

    return data;
}

// calculates the mean by pulling in the values from a text file and adding them to
// total and then taking the average 
public static double mean(int[] array) throws Exception
{
    double average;
    double total = 0;

    File file = new File("inputFile1.dat");
    Scanner readFrom = new Scanner(file);
    readFrom.nextInt();

    for (int i = 0; i < array.length; i++)
    {   
        if (readFrom.hasNextInt())
        {
            int start = readFrom.nextInt();
            array[i] = start;
        }

    }

    for (int j = 0; j < array.length; j++)
    {
        total += array[j];

    }

    average = total / array.length;
    System.out.printf("The mean of all elements is: %.2f" + "\n" , average);
    return average;
}

```

I need to somehow pass in an array to the `mean` method for it to do its job but I'm having
trouble doing so since my array doesn't have a fixed number of elements inside of it and I don't know how to deal with it this way.