static void DoWithdraw(BankAccount account, double amount, String password) { if (account.Withdraw(amount, password)) { Console.WriteLine("Withdraw Success"); } else { Console.WriteLine("Withdraw Failed"); } }
public static bool Transfer(BankAccount source, String password, double amount, BankAccount target) { if (source.Withdraw(amount, password)) { return(target.Deposit(amount)); } else { return(false); } }
static void DoTransfer(BankAccount src, int amount, String password, BankAccount target) { if (src.Withdraw(amount, password)) { target.Deposit(amount); Console.WriteLine("Tranfer completed"); } else { Console.WriteLine("Transfer Failed"); } }
static void Transfer(BankAccount src, int amount, String password, BankAccount target) { src.Withdraw(amount, password); target.Deposit(amount); }