title: Arrays, check the smallest, largest, and the average in java
body: <p>Im having some trouble on getting my methods to work, I believe I am doing something wrong in the main method to call the others.  I am not sure if I need an if, while, or for statement. Can anyone help, I really appreciate it. Here is my program...</p>
  
  <pre><code>  public static void main(String[] args) throws IOException {
      Scanner kb = new Scanner(System.in);
      final int MAX = 100;
      int [] myarray = new int [MAX];
      int fillsize, total = 0, num;
      int smallest = 0, largest = 0;
      fillsize = fillarray (myarray, MAX);
      printarray (myarray, fillsize);
  
      num = kb.nextInt(); 
      int small = num;
      int large = num;
      total = Average(total, num);
      if(smallest (num, smallest))
      {
        small = num;
      }
      if(largest(num, largest))
      {
         large = num;      
      }
      System.out.println("The smallest value is: " + smallest);
      System.out.println("The largest value is: " + largest);
      System.out.println("The average is: " + total);
  
      prw.close();
  }
  
  public static int fillarray (int[] num, int MYMAX){
      Random gen = new Random();
      int retval = 0;
      int randomnum;
      for(int count = 0; count &lt;= 30; count++){
          randomnum = gen.nextInt(150);
          num [count] = randomnum;
          System.out.println(randomnum);
          retval++;   
      }
      System.out.println("The return value is: " + retval);
      return (retval);
  }
  public static void printarray (int[] num, int fillsize){
      for (int counts = 0; counts &lt; fillsize; counts++){
          System.out.println("For the position ["+counts+"] the value is " + num[counts]);
      }
      return;
  }
  public static boolean smallest (int num1, int num2){
      boolean returnValue;
      if (num2 &lt; num1){
          returnValue = true;
      }
      else {
          returnValue = false;
      }
      return (returnValue);
  }
  public static boolean largest (int number1, int number2){
      boolean returnVal;
      if (number1 &gt; number2){
          returnVal = true;
      }
      else{
          returnVal = false;
      }
      return (returnVal);
  }
  public static int Average (int avg, int sum){
      int retVal;
      retVal = avg + sum;
      return(retVal);
  }
  </code></pre>
  
  <p>What am I doing wrong?</p>