Exemple #1
0
        static void Main(string[] args)
        {
            IPrinterWindows printer;

            Console.WriteLine("Num Printer:");
            Console.WriteLine("1. Epson");
            Console.WriteLine("2. Canon");
            Console.WriteLine("3. LaserJet\n");

            Console.WriteLine("Pilih Printer [1...3]");
            int NumPrinter = Convert.ToInt32(Console.ReadLine());

            if (NumPrinter == 1)
            {
                printer = new Epson();
            }
            else if (NumPrinter == 2)
            {
                printer = new Canon();
            }
            else
            {
                printer = new LaserJet();
            }

            printer.Show();
            printer.Print();

            Console.ReadKey();
        }
Exemple #2
0
        static void Main(string[] args)
        {
            IPrinterWindows printer;

            Console.WriteLine("Pilih Printer : ");
            Console.WriteLine("1. Epson");
            Console.WriteLine("2. Canon");
            Console.WriteLine("3. Laser Jet\n");

            Console.Write("Nomor Printer [1...3] : ");
            int nomerPrinter = Convert.ToInt32(Console.ReadLine());

            if (nomerPrinter == 1)
            {
                printer = new Epson();
            }
            else if (nomerPrinter == 2)
            {
                printer = new Canon();
            }
            else if (nomerPrinter == 3)
            {
                printer = new LaserJet();
            }
            else
            {
                Console.WriteLine("\nInput Salah\n");
                return;
            }

            printer.Show();
            printer.Print();

            Console.ReadKey();
        }
Exemple #3
0
        static void Main(string[] args)
        {
            IPrinterWindows Printer;

            Console.WriteLine("Pilih Salah Satu Printer : ");
            Console.WriteLine("1. E p s o n");
            Console.WriteLine("2. C a n o n");
            Console.WriteLine("3. L a s e r J e t \n");

            Console.Write("Nomor Printer [1...3] : ");
            int NOPrinter = Convert.ToInt32(Console.ReadLine());

            if (NOPrinter == 1)
            {
                Printer = new Epson();
            }
            else if (NOPrinter == 2)
            {
                Printer = new Canon();
            }
            else if (NOPrinter == 3)
            {
                Printer = new LaserJet();
            }
            else
            {
                Console.WriteLine("\nAnda Salah input\n");
                return;
            }


            Printer.Show();
            Printer.Print();
        }