// Fig. 10.7: BasePlusCommissionEmployeeTest.cs // Testing class BasePlusCommissionEmployee. using System; public class BasePlusCommissionEmployeeTest { public static void Main( string[] args ) { // instantiate BasePlusCommissionEmployee object BasePlusCommissionEmployee employee = new BasePlusCommissionEmployee( "Bob", "Lewis", "333-33-3333", 5000.00M, .04M, 300.00M ); // display base-salaried 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() ); Console.WriteLine( "{0} {1:C}", "Base salary is", employee.BaseSalary ); employee.BaseSalary = 1000.00M; // set base salary 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 BasePlusCommissionEmployeeTest /************************************************************************** * (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. * *************************************************************************/