Esempio n. 1
0
        public static void Main(string[] args)
        {
            Customer tan = new Customer("Tan Ah Kow", "20, Seaside Road", "XXX20", new DateTime(1989, 10, 11));
            Customer kim = new Customer("Kim Lee Keng", "2, Rich View", "XXX9F", new DateTime(1993, 4, 25));
            Customer lee = new Customer("Lee Pek Cheong", "90, River Walk", "XXX10", new DateTime(1999, 9, 9));

            SavingsAccount sa = new SavingsAccount("001-001-001", tan, 2000);
            CurrentAccount ca = new CurrentAccount("001-001-002", kim, 5000);
            OverDraftAccount oa = new OverDraftAccount("001-001-003", lee, 100);

            Console.WriteLine(sa.Show());
            Console.WriteLine(ca.Show());
            Console.WriteLine(oa.Show());

            sa.Deposit(100);
            Console.WriteLine(sa.Show());

            ca.Withdraw(50000);
            Console.WriteLine(ca.Show());

            oa.TransferTo(300, sa);
            Console.WriteLine(oa.Show());
            Console.WriteLine(sa.Show());

            sa.CreditInterest();
            ca.CreditInterest();
            oa.CreditInterest();

            Console.WriteLine(sa.Show());
            Console.WriteLine(ca.Show());
            Console.WriteLine(oa.Show());
        }
Esempio n. 2
0
        public static void Main()
        {
            Customer cus1 = new Customer("Tan Ah Kow", "2 Rich Street",
                                         "P123123", 20);
            Customer cus2 = new Customer("Kim May Mee", "89 Gold Road",
                                         "P334412", 60);

            BankAccount3 a1 = new BankAccount3("S0000223", cus1, 2000);

            Console.WriteLine(a1.CalculateInterest());
            OverdraftAccount a2 = new OverdraftAccount("O1230124", cus1, 2000);

            Console.WriteLine(a2.CalculateInterest());
            CurrentAccount a3 = new CurrentAccount("C1230125", cus2, 2000);

            Console.WriteLine(a3.CalculateInterest());
        }