That's not really simple to describe, because the code you show doesn't include an code to reduce the balances, but it does allow direct subtraction from the account values.
What I would probably do is make the property setters
private
(or possibly
protected
) instead of public to prevent that, and create a Withdraw method instead - it can check and either throw an exception or return a status code which says "insufficent funds":
public double Amount
{
get { return amount; }
private set { amount = value; }
}
public double Drawing
{
get { return drawing; }
private set { drawing = value; }
}
public double Deposit
{
get { return deposit; }
private set { deposit = value; }
}
public bool Withdraw(double withdrawl)
{
if (Amount < withdrawl) return false;
Amount -= withdrawl;
return true;
}