Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            int[] balances = { 100, 50, 1500, 160, 100, 1512, 7912 };
            var   machine  = new AtmMachine(balances);

            machine.InsertCard(2);
            machine.ShowBalance();
            machine.WithdrawCash(100);
            machine.WithdrawCash(300);
            machine.EjectCard();

            machine.InsertCard(0);
            machine.ShowBalance();
            machine.WithdrawCash(10);
            machine.EjectCard();
        }
Ejemplo n.º 2
0
 public CardInsertedState(AtmMachine machine, int[] balances, int insertedCardNumber)
 {
     this.machine            = machine;
     this.currentBalances    = balances;
     this.insertedCardNumber = insertedCardNumber;
 }
Ejemplo n.º 3
0
 public IdleState(AtmMachine machine, int[] balances)
 {
     this.machine         = machine;
     this.currentBalances = balances;
 }