public BankAccount(double balance)
if (balance <= 0) throw new Exception("Looks like you're broke buddy.");
public void TransferTo(double amount, BankAccount other)
if (Balance < amount) throw new Exception("You don't have enough money to do that.");
public void TransferFrom(double amount, BankAccount other)
if (other.Balance < amount) throw new Exception("You don't have enough money to do that.");
public double Balance { get; set; }
static void Main(string[] args)
var averyAccount = new BankAccount(10000);
var haddonAccount = new BankAccount(20);
averyAccount.TransferTo(1, haddonAccount);
averyAccount.TransferFrom(200, haddonAccount);