// Fig. 10.5: CommissionEmployeeTest.cs
// Testing class CommissionEmployee.
using System;

public class CommissionEmployeeTest
{
   public static void Main( string[] args )
   {
      // instantiate CommissionEmployee object
      CommissionEmployee employee = new CommissionEmployee( "Sue", 
         "Jones", "222-22-2222", 10000.00M, .06M );

      // display commission employee data
      Console.WriteLine(
         "Employee information obtained by properties and methods: \n" );
      Console.WriteLine( "{0} {1}", "First name is",
         employee.FirstName );
      Console.WriteLine( "{0} {1}", "Last name is",
         employee.LastName );
      Console.WriteLine( "{0} {1}", "Social security number is",
         employee.SocialSecurityNumber );
      Console.WriteLine( "{0} {1:C}", "Gross sales are",
         employee.GrossSales );
      Console.WriteLine( "{0} {1:F2}", "Commission rate is",
         employee.CommissionRate );
      Console.WriteLine( "{0} {1:C}", "Earnings are", 
         employee.Earnings() );

      employee.GrossSales = 5000.00M; // set gross sales
      employee.CommissionRate = .1M; // set commission rate

      Console.WriteLine( "\n{0}:\n\n{1}",
         "Updated employee information obtained by ToString", employee );
      Console.WriteLine( "earnings: {0:C}", employee.Earnings() );
   } // end Main
} // end class CommissionEmployeeTest


/**************************************************************************
 * (C) Copyright 1992-2006 by Deitel & Associates, Inc. and               *
 * Pearson Education, Inc. All Rights Reserved.                           *
 *                                                                        *
 * DISCLAIMER: The authors and publisher of this book have used their     *
 * best efforts in preparing the book. These efforts include the          *
 * development, research, and testing of the theories and programs        *
 * to determine their effectiveness. The authors and publisher make       *
 * no warranty of any kind, expressed or implied, with regard to these    *
 * programs or to the documentation contained in these books. The authors *
 * and publisher shall not be liable in any event for incidental or       *
 * consequential damages in connection with, or arising out of, the       *
 * furnishing, performance, or use of these programs.                     *
 *************************************************************************/
