public override string ship(Shipper shipper)
            {
                string rval = base.ship(shipper);

                return(rval + "**MARK RETURN RECEIPT REQUESTED**");
            }
            public override string ship(Shipper shipper)
            {
                string rval = base.ship(shipper);

                return(rval + "**MARK FRAGILE**");
            }
            public override string ship(Shipper shipper)
            {
                string rval = base.ship(shipper);

                return(rval + "**MARK DO NOT LEAVE IF ADDRESS NOT AT HOME**");
            }
 protected override double calculateCost(double weight, Shipper shipper)
 {
     return(0);
 }
 public override string ship(Shipper shipper)
 {
     return(nextShipment.ship(shipper));
 }
Ejemplo n.º 6
0
 protected override double calculateCost(double weight, Shipper shipper)
 {
     return(shipper.GetPackageCost(weight) + shipper.GetOversizeSurcharge(weight));
 }
Ejemplo n.º 7
0
 protected override double calculateCost(double weight, Shipper shipper)
 {
     return(shipper.GetPackageCost(weight));            //have different method for different sizes rather than passing in parameters
     //open for extension not modification
 }
Ejemplo n.º 8
0
 // protected = only available in this class and derived classes
 //virtual = can be overridden
 //the derived Shipper class can be passed to an instance of the Shipper class as it implements all of its properties.
 protected abstract double calculateCost(double weight, Shipper shipper);         //delegating implementation to sub classes