예제 #1
0
        public void PayDay(Paycheck paycheck)
        {
            double grossPay = classification.CalculatePay(paycheck);

            paycheck.GrossPay = grossPay;
            method.Pay(paycheck);
        }
예제 #2
0
        public void PayDay(Paycheck paycheck)
        {
            paycheck.GrossPay   = PaymentClassification.CalculatePay(paycheck);
            paycheck.Deductions = Affiliation.CalculateDeductions(paycheck);

            PaymentMethod.Pay(paycheck);
        }
예제 #3
0
 public void PayTShirt(TShirt tshirt)
 {
     foreach (var variation in _variations)
     {
         Console.WriteLine($"Applying {variation.GetType().Name}");
         variation.Cost(tshirt);
         Console.WriteLine($"TShirt cost after applying {variation.GetType().Name} is: {tshirt.Price}");
     }
     _paymentMethod.Pay(tshirt.Price);
 }
예제 #4
0
        public void PayDay(Paycheck paycheck)
        {
            double grossPay   = classification.CalculatePay(paycheck);
            double deductions = affiliation.CalculateDeductions(paycheck);
            double netPay     = grossPay - deductions;

            paycheck.GrossPay   = grossPay;
            paycheck.Deductions = deductions;
            paycheck.NetPay     = netPay;
            method.Pay(paycheck);
        }