Example #1
0
    public static void Main(string[] args)
    {
        // open a bank account
        BankAccount ba = new BankAccount(20);

        ba.Deposit(10);
        Console.WriteLine(ba.BankAccountString());

        int i = 8;

        while (i-- > 0)
        {
            ba.Withdraw(6);
            Console.WriteLine(ba.BankAccountString());
        }

        Console.WriteLine();

        // open a savings account
        SavingsAccount sa = new SavingsAccount(0.06, 45);

        Console.WriteLine(sa.SavingsAccountString());
        sa.AccumulateInterest();
        Console.WriteLine(sa.SavingsAccountString());
        sa.AccumulateInterest();
        Console.WriteLine(sa.SavingsAccountString());
        sa.Deposit(10);
        Console.WriteLine(sa.SavingsAccountString());
        sa.Withdraw(15);
        Console.WriteLine(sa.SavingsAccountString());
        sa.AccumulateInterest();
        Console.WriteLine(sa.SavingsAccountString());
    }