Esempio n. 1
0
        static void Main(string[] args)
        {
            CheckingAccount a = new CheckingAccount();
            a.DepositRules += (am, bl) => { if (am > 10000) Console.WriteLine("Call the government."); };
            a.WithdrawRules += (am, bl) => { if (bl < 0) Console.WriteLine("Balance is below 0."); };

            a.Deposit(11000);
            a.Withdraw(6000);
            a.Withdraw(6000);

            Console.ReadLine();
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            CheckingAccount a = new CheckingAccount();

            // this is a comment to see if we can commit to github

            a.DepositAction += new AccountAction(a_DepositAction);
            a.WithdrawAction += (amount, balance) => { if (balance <= 0) Console.Write("Balance is at or below zero!"); };

            a.Deposit(11000);
            a.Withdraw(6000);
            a.Withdraw(6000);

            Console.ReadLine();
        }