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)); }
protected override double calculateCost(double weight, Shipper shipper) { return(shipper.GetPackageCost(weight) + shipper.GetOversizeSurcharge(weight)); }
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 }
// 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