Пример #1
0
 public static void Main(string[] args)
 {
     BankAccount ba;
     SavingsAccount sa;
     // Display the resulting balance.
     Console.WriteLine("Withdrawal: MakeAWithdrawal(ba, ...)");
     ba = new BankAccount(200M);
     MakeAWithdrawal(ba, 100M);
     Console.WriteLine("BankAccount balance is {0:C}", ba.Balance);
     Console.WriteLine("Withdrawal: MakeAWithdrawal(sa, ...)");
     sa = new SavingsAccount(200M, 12);
     MakeAWithdrawal(sa, 100M);
     Console.WriteLine("SavingsAccount balance is {0:C}", sa.Balance);
     // Wait for user to acknowledge the results.
     Console.WriteLine("Press Enter to terminate...");
     Console.Read();
 }
Пример #2
0
 public static void MakeAWithdrawal(BankAccount ba, decimal amount)
 {
     ba.Withdraw(amount);
 }