示例#1
0
 public void Deposit(int amt)
 {
     if (amt <= 0)
     {
         AtmException ex = new AtmException("invalid figure to deposit");
         throw ex;
     }
     Balance += amt;
 }
示例#2
0
 public void WithDraw(int amt)
 {
     if (amt > Balance)
     {
         AtmException ex = new AtmException("insufficient funds to withdraw!!!");
         throw ex;
     }
     else
     {
         Balance -= amt;
     }
 }