May 2010
Intermediate to advanced
1752 pages
41h 17m
English
Recall that the Employee base class defined a method named GiveBonus(), which was originally implemented as follows:
public partial class Employee
{
public void GiveBonus(float amount)
{
currPay += amount;
}
...
}
Because this method has been defined with the public keyword, you can now give bonuses to salespeople and managers (as well as part-time salespeople):
static void Main(string[] args) { Console.WriteLine("***** The Employee Class Hierarchy *****\n"); // Give each employee a bonus? Manager chucky = new Manager("Chucky", 50, 92, 100000, "333-23-2322", 9000); chucky.GiveBonus(300); chucky.DisplayStats(); Console.WriteLine(); SalesPerson fran = new SalesPerson("Fran", 43, 93, 3000, ...