/*****************************************************************
** EmployeeTest - program to test the Employee class
**
** Employee information is read from stdin.  For example, if a 
** file named test.dat exists with the following employee 
** information
**
**    Smith
**    4565.34
**    Jones
**    4323.56
**    Baker
**    3954.67
**    Cook
**    5432.99
**    King
**    4321.34
**    #
**
** the EmployeeTest program could be invoked as follows: 
**
**	PROMPT>java EmployeeTest < test.dat
**	5 employees
**	Highest paid: Cook, $5432.99
**	Lowest paid: Baker, $3954.67
**
** (c) Scott MacKenzie, 2000                             
******************************************************************/
import java.io.*;
import java.util.*;

public class EmployeeTest
{
   public static void main(String[] args) throws IOException
   {
      BufferedReader stdin =
         new BufferedReader(new InputStreamReader(System.in), 1);

      // read workers from standard input, put in dynamic array
      Vector workers = new Vector();
      String name;
      while (!(name = stdin.readLine()).equals("#"))
      {
         double salary = Double.parseDouble(stdin.readLine());
         Employee e = new Employee(name, salary);
         workers.addElement(e);
      }

      // find highest and lowest paid workers
      Employee high = (Employee)workers.elementAt(0);
      Employee low = high;
      for (int i = 1; i < workers.size(); i++)
      {
         Employee e = (Employee)workers.elementAt(i);
         if (!high.isHigherPaidThan(e))
            high = e;
         if (low.isHigherPaidThan(e))
            low = e;
      }

      // print results
      System.out.println(workers.size() + " employees");
      System.out.println("Highest paid: " + high);
      System.out.println("Lowest paid: " + low);
   }
}

