How to return person with max sales in salesperson program- JAVA
<p>Kind of confused by one part of my HW problem. It seems like it would be easy, but I can't put my finger on it. I am trying to return the salesperson with the max and min sales. I am confused on how to do that. Help would be much appreciated.</p>

<pre><code>import java.util.Scanner;
public class Cray {
    public static void main(String[] args){

        final int SALESPEOPLE = 5;
        int[] sales = new int[SALESPEOPLE];
        int sum, maxperson, minperson;
        int max = sales[0];
        int min = sales[0];



        Scanner scan = new Scanner(System.in);
        //Fill the 5 element array of sales with the user's input
        for (int i=0; i&lt;sales.length; i++)
            {
            System.out.print("Enter sales for salesperson " + i + ": ");
            sales[i] = scan.nextInt();
            //Calculate the max and min sales
            //How do I return the salesperson i with the the max and min sales?
            if(sales[i] &gt; max){
                max= sales[i];
            }
            if(sales[i] &lt; min){
                min = sales [i];
            }


            }



        System.out.println("\nSalesperson   Sales");
        System.out.println("--------------------");
        sum = 0;
        for (int i=0; i&lt;sales.length; i++)
            {
            System.out.println("     " + i + "         " + sales[i]);
            sum += sales[i];
            }

        System.out.println("\nTotal sales: " + sum);
        System.out.println("Average sales: " + sum/5);
        //WHere I want to print the max salesperson.
        System.out.println("Salesperson" +  );

          }

        }
</code></pre>
