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(); }
public CardInsertedState(AtmMachine machine, int[] balances, int insertedCardNumber) { this.machine = machine; this.currentBalances = balances; this.insertedCardNumber = insertedCardNumber; }
public IdleState(AtmMachine machine, int[] balances) { this.machine = machine; this.currentBalances = balances; }