Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Account a1 = new Fixed("NISHI", "1", 10000, 2020, 5);
            Account a2 = new Savings("SAkIB", "2", 50000, 10);
            Account a3 = new SpecialSavings("NIDHI", "3", 20000, 5);
            Account a4 = new Overdraft("AKASH", "4", 150000, 20000);


            a1.Withdraw(500);
            a2.Withdraw(500);
            a3.Withdraw(500);
            a4.Withdraw(500);



            a1.Withdraw(5000);
            a2.Withdraw(40000);
            a3.Withdraw(6000);
            a4.Withdraw(10000);
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            SavingAccount s = new SavingAccount("Sadman", "101", 1000);

            s.Withdraw(800);
            FixedAccount f = new FixedAccount("Sadman", "102", 1000, 2022);

            f.Withdraw(200);
            SpecialSavings ss = new SpecialSavings("Sadman", "104", 1000, 2);

            ss.Withdraw(900);
            ss.Withdraw(200);
            ss.Withdraw(200);
            ss.Withdraw(200); // should exceed monthly limit
            Overdraft od = new Overdraft("Sadman", "101", 1000, 500);

            od.Withdraw(1200);
            od.Withdraw(100);
            od.Withdraw(300); // should exceed OVerhead limit
        }