コード例 #1
0
        static void Main(string[] args)
        {
            Bill myBill = new Bill(15.80, 0.06);

            Pay(myBill);
            Bill myBillWithTip = new TippableBill(2.00, 8.50, 0.06);

            Pay(myBillWithTip);
        }
コード例 #2
0
        static void Main(string[] args)
        {
            Bill bill = new Bill()
            {
                Subtotal = 15.80,
                TaxRate  = 0.06
            };

            Pay(bill);

            TippableBill tippableBill = new TippableBill()
            {
                Subtotal = 8.50,
                TaxRate  = 0.06,
                Tip      = 2.00,
            };

            Pay(tippableBill);
        }