Ejemplo n.º 1
0
 double NormalShippingRate(Order order)
 {
     var shipping = order.Total * .08;
     if (shipping > 200) shipping = 200;
     return shipping;
 }
Ejemplo n.º 2
0
 double DiscountShippingRate(Order order)
 {
     var shipping = order.Total * 0.05;
     if (shipping > 100) shipping = 100;
     return shipping;
 }
Ejemplo n.º 3
0
 bool LargeOrImportantOrder(Order order)
 {
     return order.Customer.Status == "P" || (order.Total > 1000 && order.Weight < 500);
 }
Ejemplo n.º 4
0
 public double GetShippingCost(Order order)
 {
     double shipping;
     shipping = LargeOrImportantOrder(order) ? DiscountShippingRate(order) : NormalShippingRate(order);
     return shipping;
 }