예제 #1
0
        void Start()
        {
            ATMMachine machine = new ATMMachine(2000);

            machine.InsertCard();
            machine.RejectCard();
            machine.InsertCard();
            machine.EnterPincode(1234);
            machine.WithdrawCash(1500);
            machine.InsertCard();
            machine.EnterPincode(1234);
            machine.WithdrawCash(750);
            Console.ReadKey();
        }
예제 #2
0
        static void Main(string[] args)
        {
            ATMMachine machine = new ATMMachine(2000);

            machine.InsertCard();
            machine.RejectCard();

            machine.InsertCard();
            machine.EnterPincode(1234);
            machine.WithdrawCash(1500);

            machine.InsertCard();
            machine.EnterPincode(1234);
            machine.WithdrawCash(750);
            Console.ReadLine();
        }
예제 #3
0
 public NoCashState(ATMMachine machine)
 {
     this.machine = machine;
 }
예제 #4
0
 public CorrectPinState(ATMMachine machine)
 {
     this.machine = machine;
 }
예제 #5
0
 public CardPresentState(ATMMachine machine)
 {
     this.machine = machine;
 }