public static void Main()
var product = new Product
Console.WriteLine(Helper.Shipping(product, 5, "FedEx"));
public decimal Price { get; set; }
public bool IsFragile { get; set;}
public bool IsOverWeight { get; set;}
public bool IsExpensive { get; set;}
public static class Helper
public static decimal Tax(Product product, string shippingMethod)
if (shippingMethod == "FedEx") return 0.1m;
if (shippingMethod == "DHL") return 0.15m;
if (shippingMethod == "Free") return 0;
public static decimal Shipping(Product product, decimal expensiveLimit, string shippingMethod)
c = product.Price * 0.1m;
if (product.IsOverWeight)
c = product.Price * 0.25m;
if (product.IsOverWeight)
product.IsExpensive = c > expensiveLimit;