コード例 #1
0
        static void Main(string[] args)
        {
            Account a2 = new SavingsAccount("Alamin", "3333", 30000);

            a2.transaction(1500);
            Console.WriteLine();
            a2.transaction(2000);
            a2.transaction(2000);
            a2.transaction(2000);
            a2.transaction(2000);
            a2.transaction(2000);

            a2.transaction(2000);
            a2.ShowInfo();
            Console.WriteLine();


            FixedAccount a4 = new FixedAccount("Rana ", "4444", 5555, 20000);

            a4.transaction(3000);
            a4.ShowInfo();
            Console.WriteLine();

            SpecialSavingsAccount a1 = new SpecialSavingsAccount("Ahamed", "6666", 2000);
            SpecialSavingsAccount a7 = new SpecialSavingsAccount("Ahamed", "7777", 1000);

            a1.transaction(300);
            a1.transaction(300);
            a1.transaction(300);
            a1.transaction(300);
            a1.transaction(300);
            a1.transaction(300);

            a7.transaction(500);
            a1.ShowInfo();
            a7.ShowInfo();
            Console.WriteLine();


            Account a3 = new OverDraftAccount("Ahamed ", "111", 10000);

            a3.transaction(5000);
            a3.ShowInfo();
            Console.WriteLine();
        }
コード例 #2
0
        static void Main(string[] args)
        {
            Account a2 = new SavingsAccount("Reza", "1122", 10000);

            a2.transaction(9580);
            Console.WriteLine();
            a2.transaction(1000);
            a2.transaction(1000);
            a2.transaction(1000);
            a2.transaction(1000);
            a2.transaction(1000);

            a2.transaction(1000);
            a2.ShowInfo();
            Console.WriteLine();


            FixedAccount a4 = new FixedAccount("DBL", "2123", 2020, 15000);

            a4.transaction(2000);
            a4.ShowInfo();
            Console.WriteLine();

            SpecialSavingsAccount a1 = new SpecialSavingsAccount("Sufian", "2000", 5000);
            SpecialSavingsAccount a7 = new SpecialSavingsAccount("Sufian", "2900", 300);

            a1.transaction(100);
            a1.transaction(100);
            a1.transaction(100);
            a1.transaction(100);
            a1.transaction(100);
            a1.transaction(100);

            a7.transaction(450);
            a1.ShowInfo();
            a7.ShowInfo();
            Console.WriteLine();


            Account a3 = new OverDraftAccount("MDBL2", "555", 5000);

            a3.transaction(5750);
            a3.ShowInfo();
            Console.WriteLine();
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: SSK98/OOP2_LAB
        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
        }