title: Help with Arrays for Java
body: <pre><code>// ****************************************************************
  // Sales.java
  //
  // Reads in and stores sales for each of 5 salespeople.  Displays
  // sales entered by salesperson id and total sales for all salespeople.
  //
  // ****************************************************************
  import java.util.Scanner;
  
  public class Sales
  {
      public static void main(String[] args)
      {
      final int SALESPEOPLE = 5;
      int[] sales = new int[SALESPEOPLE];
      int sum;
      int average;
      int max=sales[0];
      int min=sales[0];
      int salemade;
      Scanner scan = new Scanner(System.in);
  
      for (int i=0; i&lt;sales.length; i++)
          {
          System.out.print("Enter sales for salesperson " + (i+1) + ": ");
          sales[i] = scan.nextInt();
          }
      // Find maximum and minimum sale value   
      for (int i=0; i&lt;sales.length; i++)
  
          if(sales[i]&gt;max)
          max=sales[i];
          System.out.println("Salesperson "+sale[i]+ "has the max sale of $ " + max);  
          if(sales[i]&lt;min)
          min=sales[i];
      System.out.println("Salesperson "+sale[i]+ "has the min sale of $ "+min);
  // List of sales
      System.out.println("\nSalesperson   Sales");
      System.out.println("--------------------");
      sum = 0;
  
  
      for (int i=0; i&lt;sales.length; i++)
          {
          System.out.println("     " + (i+1) + "         " + sales[i]);
          sum += sales[i];
          }
  
          average= sum/5;
      System.out.println("\nTotal sales: " + sum);
      System.out.println("The average sale is:$ "+average);
  
      //See who exeeded the max sale
      System.out.println("Enter the amount of sale made");
      salemade=scan.nextInt();
  
      for(int i=0; i=sales.length; i++)
          {
          if(sales[i]&gt;=salemade)
          System.out.println(sales[i]);
          }
  
      }
  }
  </code></pre>
  
  <p>I'm trying to write this program that asked the user to put in the amount of sales of 5 people, and it will display the max and min value and print out the sale person id and amount of min and max sale("Salesperson 3 had the highest sale with $4500.") after the program prints the min, max and average, it will ask the user to enter a random number and compares it to those previous number and see who met or exeeded the max amount and print that person id. I'm having trouble getting it done.Can some one take a look and help me? These are the error i got</p>
  
  <pre><code>Sales.java:33: cannot find symbol
  symbol  : variable sale
  location: class Sales
          System.out.println("Salesperson "+sale[i]+ "has the max sale of $ " + max);  
                                            ^
  Sales.java:33: cannot find symbol
  symbol  : variable i
  location: class Sales
          System.out.println("Salesperson "+sale[i]+ "has the max sale of $ " + max);  
                                                 ^
  Sales.java:34: cannot find symbol
  symbol  : variable i
  location: class Sales
          if(sales[i]&lt;min)
                   ^
  Sales.java:35: cannot find symbol
  symbol  : variable i
  location: class Sales
          min=sales[i];
                    ^
  Sales.java:36: cannot find symbol
  symbol  : variable sale
  location: class Sales
      System.out.println("Salesperson "+sale[i]+ "has the min sale of $ "+min);
                                        ^
  Sales.java:36: cannot find symbol
  symbol  : variable i
  location: class Sales
      System.out.println("Salesperson "+sale[i]+ "has the min sale of $ "+min);
                                             ^
  Sales.java:57: incompatible types
  found   : int
  required: boolean
      for(int i=0; i=sales.length; i++)
                    ^
  7 errors
  </code></pre>