public void Transfer(decimal amt, BankAccount one, BankAccount two) { if(one.IsOpen && two.IsOpen && amt <= one.Ammount) { two.Ammount += amt; one.Ammount -= amt; } }
public void Transfer(BankAccount destination, BankAccount start, decimal amount) { //open? enough $$ in account? if (destination.IsOpen && start.IsOpen) { if (start.Amount >= amount) { start.Amount -= amount; destination.Amount += amount; } else { Console.WriteLine("Transaction unsuccessful! Not enough $$ in account!"); } } else { Console.WriteLine("Transaction unsuccessful! One of the accounts is closed!"); } }