Guest User

Untitled

a guest
Oct 23rd, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. class Program
  2. {
  3. static void Main(string[] args)
  4. {
  5. var purchaseOrder = new PurchaseOrder("Solution", new DiscountService(), 1000);
  6. Print(purchaseOrder);
  7. purchaseOrder = new PurchaseOrder("Solution", new DiscountService(), 2000);
  8. Print(purchaseOrder);
  9. purchaseOrder = new PurchaseOrder("Solution", new DiscountService(), 2400);
  10. Print(purchaseOrder);
  11. purchaseOrder = new PurchaseOrder("Solution", new DiscountService(), 3000);
  12. Print(purchaseOrder);
  13. }
  14.  
  15. public static void Print(PurchaseOrder purchaseOrder)
  16. {
  17. var result = purchaseOrder.CalculateOrderPriceWithDiscount();
  18. Console.WriteLine(" " + purchaseOrder.Title + " - " + " Value: " + purchaseOrder.Value + " OrderPrice: " + result);
  19. }
  20. }
Add Comment
Please, Sign In to add comment