// ****************************************************************
// 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) {
    
    /* when an array is going to be a fixed size, using a constant like the one used
     * below to define the size of the array is a good idea.  The name of the constant
     * is a better indicator of why the array is the size that it is.
     */
    
    Scanner scan = new Scanner(System.in);
    
    System.out.println("Please enter the total number of salespeople:");
    int salespeople = scan.nextInt();
    
    int[] sales = new int[salespeople];
    int sum = 0;
    int maximumSales;
    
    for (int i=0; i<sales.length; i++) {
      System.out.print("Enter sales for salesperson " + i + ": ");
      sales[i] = scan.nextInt();
    }
    
    maximumSales = sales[0];
    
    System.out.println("\nSalesperson   Sales");
    System.out.println("--------------------");
    for (int i=0; i<sales.length; i++) {
      System.out.println("     " + i + "         $" + sales[i]);
      sum += sales[i];
      if (sales[i] > maximumSales) {
        maximumSales = i;
      }
    }
    
    System.out.println("\nTotal sales: $5" + sum);
    System.out.println("Average sales: $" + (sum / salespeople));
    System.out.println("\nHighest sales by Salesperson " + maximumSales + " with $" + sales[maximumSales]);
  }
}
@@ -879,16 +879,93 @@
 mumSales
+ = 0;%0A    int minimumSales = 0;%0A    int qualifier;%0A    int qualifierTotal = 0
 ;%0A    %0A 
@@ -1119,42 +1119,8 @@
    %0A
-    maximumSales = sales%5B0%5D;%0A    %0A
     
@@ -1362,16 +1362,22 @@
 es%5Bi%5D %3E 
+sales%5B
 maximumS
@@ -1380,16 +1380,17 @@
 mumSales
+%5D
 ) %7B%0A    
@@ -1411,16 +1411,93 @@
 es = i;%0A
+      %7D else if (sales%5BminimumSales%5D %3E sales%5Bi%5D) %7B%0A        minimumSales = i;%0A
       %7D%0A
@@ -1732,13 +1732,643 @@
 ales%5D);%0A
+    System.out.println(%22Lowest sales by Salesperson %22 + minimumSales + %22 with $%22 + sales%5BminimumSales%5D);%0A    %0A    System.out.println(%22%5CnEnter a monetary value to see how many salespeople met or exceeded that amount:%22);%0A    qualifier = scan.nextInt();%0A    %0A    for (int i=0; i%3Csales.length; i++) %7B%0A      if (sales%5Bi%5D %3E= qualifier) %7B%0A        qualifierTotal++;%0A        System.out.println(%22Salesperson %22 + i + %22 met or exceeded $%22 + qualifier + %22 with a total of $%22 +%0A                           sales%5Bi%5D + %22.%22);%0A      %7D%0A    %7D%0A    System.out.println(%22In total, %22 + qualifierTotal + %22 salespeople met or exceeded $%22 + qualifier + %22.%22);%0A
   %7D%0A%7D

Add max/min sales and averages