#include <iostream>

#include <iomanip>      // declares output formatting objects

#include "employee1.h"

const double Employee::GROSS_PAY_SENTINEL = -1.0;
const string Employee::EMPTY_STRING = "";
const string Employee::NAME_SENTINEL = "*";


Employee::Employee()
{
   name = EMPTY_STRING;
   grossPay = 0.00;
} // default constructor


bool Employee::isSentinel() const
{
   if (name == NAME_SENTINEL && grossPay == GROSS_PAY_SENTINEL)
      return true;
   return false;
} // isSentinel


void Employee::readInto()
{
   const string NAME_AND_PAY_PROMPT =
       "Please enter a name and gross pay; to quit, enter ";

   cout << NAME_AND_PAY_PROMPT << NAME_SENTINEL << " "
        << GROSS_PAY_SENTINEL << ": ";
   cin >> name >> grossPay;
} // readInto


void Employee::printOut() const
{
    cout << "is " << name << "  $" << setiosflags(ios::fixed)
         << setprecision (2) << grossPay << endl;
} // printOut


void Employee::getCopyOf (const Employee &otherEmployee)
{
   name = otherEmployee.name;
   grossPay = otherEmployee.grossPay;
} // getCopyOf


bool Employee::makesMoreThan (const Employee &otherEmployee) const
{
   return grossPay > otherEmployee.grossPay;
} // makesMoreThan



