Ejemplo n.º 1
0
        private static void StateHomework()
        {
            var machine = new CopyMachine();

            machine.PutMoney(6);
            machine.SetDevice(new UsbFlashDrive());
            machine.ChooseDocument(new WordDocument());
            machine.PrintDocument();
            machine.ChooseDocument(new PdfDocument());
            machine.PrintDocument();
            var c = machine.GetBackChange();

            Console.WriteLine(c);
        }
Ejemplo n.º 2
0
        public static void CopyMachineExample3()
        {
            var copyMachine = new CopyMachine(5);

            copyMachine.InsertMoney(20);
            copyMachine.ChooseDevice(Device.FlashCard);
            copyMachine.ChooseDocument("very important document", 3);
            copyMachine.PrintDocument();
            copyMachine.PrintMoreDocuments(true);
            copyMachine.ChooseDevice(Device.WiFi);
            copyMachine.ChooseDocument("second very important document", 1);
            copyMachine.PrintDocument();
            copyMachine.PrintMoreDocuments(false);
            var change = copyMachine.GetChange();
        }