예제 #1
0
        void Pay(int amount)
        {
            int current = money.GetCash();

            if (current < amount)
            {
                MessageBox.Show("Not enough money.");
            }
            else
            {
                money.SetCash(current - amount);
            }
        }
예제 #2
0
 public void GetBalance()
 {
     MessageBox.Show("Your balance: " + money1.GetCash() + ".");
 }
예제 #3
0
 /*!
  *  \return double
  *  Shows users's balance.
  */
 public double GetBalance()
 {
     return(money1.GetCash());
 }
예제 #4
0
 public void PayCredit(IMoney m)
 {
     m.SetCash(m.GetCash() - GetCredit());
     SetCredit(0);
 }