public static void Main()
    {
        Engineer      e = new Engineer("George", 15.50F);
        CivilEngineer c = new CivilEngineer("Sir John", 40F);

        Console.WriteLine("{0} charge = {1}",
                          e.TypeName(),
                          e.CalculateCharge(2F));
        Console.WriteLine("{0} charge = {1}",
                          c.TypeName(),
                          c.CalculateCharge(0.75F));
    }
示例#2
0
    public static void Main()
    {
        Engineer      e = new Engineer("Hank", 21.20f);
        CivilEngineer c = new CivilEngineer("Sir John", 40f);

        Console.WriteLine("{0} charge = {1}",
                          e.TypeName(),
                          e.CalculateCharge(2f));

        Console.WriteLine("{0} charge = {1}",
                          c.TypeName(),
                          c.CalculateCharge(0.75f));

        Console.WriteLine("Name is: {0}", e.TypeName());
    }