using System.Collections.Generic;
public static void Main()
OrderingFascade of = new OrderingFascade();
of.PlaceOrder(12, 22.50);
public class OrderingFascade
private Accounting acct = new Accounting();
private Warehouse wh = new Warehouse();
public int PlaceOrder(int productId, double amt)
if (productId > 0 && amt > 0)
if (wh.IsInInventory(productId))
orderId = (int)Math.Round(Math.PI * DateTime.Now.Second, 0);
if (!acct.ProcessPayment(amt, orderId))
throw new Exception($"Payment for order {orderId} failed.");
throw new Exception($"Product {productId} is out of stock.");
public bool ProcessPayment(double amt, int orderId)
if (orderId > 0 && amt > 0)
public bool IsInInventory(int productId)