#include <iostream>

#include "company1.h"  

Company::Company()
{
    atLeastOneEmployee = false;
} // default constructor


void Company::findBestPaid()
{
   Employee employee;

   employee.readInto();
   if (!employee.isSentinel())
   {
        atLeastOneEmployee = true; 
        while(!employee.isSentinel())
        {
            if (employee.makesMoreThan(bestPaid))
                bestPaid.getCopyOf (employee);
            employee.readInto();
        } // while
   } // input does not start with sentinel
} // findBestPaid


void Company::printBestPaid() const
{
   const string BEST_PAID_MESSAGE =
      "\n\n\nThe best-paid employee (and gross pay) ";

   cout << BEST_PAID_MESSAGE;
   bestPaid.printOut();
} // printBestPaid


