예제 #1
0
    public static void Main(string[] args)
    {
      // Create a bank account and display it.
      BankAccount ba = new BankAccount(100);
      DirectDeposit(ba, 100);
      Console.WriteLine("Account {0}", ba.ToBankAccountString());

      // Now a savings account.
      SavingsAccount sa = new SavingsAccount(12.5M);
      DirectDeposit(sa, 100);
      sa.AccumulateInterest();
      Console.WriteLine("Account {0}", sa.ToSavingsAccountString());

      // Wait for user to acknowledge the results.
      Console.WriteLine("Press Enter to terminate...");
      Console.Read();
    }
예제 #2
0
 // DirectDeposit - Deposit my paycheck automatically.
 public static void DirectDeposit(BankAccount ba, decimal pay)
 {
   ba.Deposit(pay);
 }
예제 #3
0
 // DirectDeposit -- Deposit my paycheck automatically.
 public static void DirectDeposit(BankAccount ba, decimal pay)
 {
     ba.Deposit(pay);
 }