public BankAccount(double balance)
if (balance < 0) throw new Exception("you can't do that");
public void TransferTo(double money, BankAccount other)
if (money < 0) throw new Exception("Money < 0");
if (money > Balance) throw new Exception("You cannot withdraw this much");
public void TransferFrom(double money, BankAccount other)
if (money < 0) throw new Exception("Money < 0");
if (money > other.Balance) throw new Exception("You cannot withdraw this much");
public double Balance { get; private set; }
public void Main(string[] args)
var BankAccount1 = new BankAccount(5000);
var BankAccount2 = new BankAccount(3000);