Пример #1
0
        public override void ApplyTransaction()
        {
            var amount = accountBalance * InterestRate;
            var type   = "Add Interest";

            this.accountBalance += amount;
            var addInterest = new Transaction(amount, type);

            TransactionQueue.AddRemove(addInterest);
        }
Пример #2
0
        public override void ApplyTransaction()
        {
            var amount = this.ServiceFee;
            var type   = "Service Fee";

            this.accountBalance -= amount;
            var addSerivceFee = new Transaction(amount, type);

            TransactionQueue.AddRemove(addSerivceFee);
        }
Пример #3
0
        static void Main(string[] args)
        {
            var myCheckingAccount = new CheckingAccount();

            myCheckingAccount.accountBalance    = 1000;
            myCheckingAccount.accountHolderName = "Jim";
            myCheckingAccount.accountNumber     = 1945;
            myCheckingAccount.ServiceFee        = 5;


            var mySavingsAccount = new SavingsAccount("Jim", 5000, .09);

            mySavingsAccount.ApplyTransaction();
            Console.WriteLine("after interest add transaction: " + mySavingsAccount.accountBalance);

            myCheckingAccount.ApplyTransaction();
            Console.WriteLine("After fee transaction: " + myCheckingAccount.accountBalance);

            TransactionQueue.AddRemove("R");
            TransactionQueue.AddRemove("r");
        }