Example #1
0
        public static void Main(string[] args)
        {
            // Create a bank account and display it.
            BankAccount ba = new BankAccount();

            ba.InitBankAccount(100M); // M suffix indicates decimal.
            ba.Deposit(100M);
            Console.WriteLine("Account {0}", ba.ToBankAccountString());
            // Now a savings account.
            SavingsAccount sa = new SavingsAccount();

            sa.InitSavingsAccount(100M, 12.5M);
            sa.AccumulateInterest();
            Console.WriteLine("Account {0}", sa.ToSavingsAccountString());
            // Wait for user to acknowledge the results.
            Console.WriteLine("Press Enter to terminate...");
            Console.Read();
        }
Example #2
0
 // DirectDeposit - deposit my paycheck automatically
 public static void DirectDeposit(BankAccount ba, decimal mPay)
 {
     ba.Deposit(mPay);
 }
Example #3
0
 public static void Main(string[] args)
 {
     // Create a bank account and display it.
       BankAccount ba = new BankAccount();
       ba.InitBankAccount(100M); // M suffix indicates decimal.
       ba.Deposit(100M);
       Console.WriteLine("Account {0}", ba.ToBankAccountString());
       // Now a savings account
       SavingsAccount sa = new SavingsAccount();
       sa.InitSavingsAccount(100M, 12.5M);
       sa.AccumulateInterest();
       Console.WriteLine("Account {0}", sa.ToSavingsAccountString());
       // Wait for user to acknowledge the results.
       Console.WriteLine("Press Enter to terminate...");
       Console.Read();
 }