Ejemplo n.º 1
0
 static void PrintPensionAmount(PublicServant servant)
 {
     if (servant is Firefighter)
         Console.WriteLine("Pension of firefighter: " + servant.PensionAmount);
     else if (servant is PoliceOfficer)
         Console.WriteLine("Pension of officer: " + servant.PensionAmount);
 }
Ejemplo n.º 2
0
 static void PrintPensionAmount(PublicServant servant)
 {
     if (servant is Firefighter)
     {
         Console.WriteLine("Pension of firefighter: " + servant.PensionAmount);
     }
     else if (servant is PoliceOfficer)
     {
         Console.WriteLine("Pension of officer: " + servant.PensionAmount);
     }
 }