Esempio n. 1
0
        static void Main(string[] args)
        {
            IPrinterWindows Printer;

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

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

            if (NomorPrinter == 1)
            {
                Printer = new Epson();
            }
            else if (NomorPrinter == 2)
            {
                Printer = new Canon();
            }
            else
            {
                Printer = new LaserJet();
            }

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

            Console.ReadKey();
        }
Esempio n. 2
0
        public static void Main(string[] args)
        {
            IPrinterWindows printer;

            Console.WriteLine("Pilih Printer : ");
            Console.WriteLine("1.Epson");
            Console.WriteLine("2.Canon");
            Console.WriteLine("3.LaserJet");

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

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

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

            Console.ReadKey();
        }
        static void Main(string[] args)
        {
            Console.WriteLine("Pilih Printer: ");
            Console.WriteLine("1. Epson");
            Console.WriteLine("2. Canon");
            Console.WriteLine("3. LaserJet\n");

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

            IPrinterWindows printer = null;

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

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

            Console.ReadKey();
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            Console.WriteLine("Pilih Printer: \n1. Epson\n2. Canon\n3. LaserJet");

            Console.Write("\nNomor Printer [1..3] : ");
            int nomorPrinter = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine();

            IPrinterWindows printer = new PrinterWindows();

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

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

            Console.ReadKey();
        }
Esempio n. 5
0
        static void Main(string[] args)
        {
            Printer printer = new Printer();

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

            Console.Write("Pilih Berdasarkan Nomer Printer : ");
            int NoPrinter = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine("\n");

            IPrinter ptr;

            if (NoPrinter == 1)
            {
                ptr = new Epson();
            }
            else if (NoPrinter == 2)
            {
                ptr = new Canon();
            }
            else
            {
                ptr = new LaserJet();
            }

            ptr.show(printer);
            ptr.print(printer);

            Console.ReadKey();
        }
Esempio n. 6
0
        static void Main(string[] args)
        {
            Console.WriteLine();

            Console.WriteLine("Pilih Printer:");
            Console.WriteLine("1. Epson");
            Console.WriteLine("2. Canon");
            Console.WriteLine("3. LaserJet");
            Console.Write("Nomor Printer [1 ... 3] : ");
            int pilihPrinter = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine();

            Printerw printer = new printer();

            if (pilihPrinter > 0 && pilihPrinter < 4)
            {
                if (pilihPrinter == 1)
                {
                    printer = new Epson();
                }
                else if (pilihPrinter == 2)
                {
                    printer = new Canon();
                }
                else
                {
                    printer = new LaserJet();
                }
            }
            else
            {
                Console.WriteLine("Pilihan tidak valid \n");
            }

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

            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine("Nama\t: Muh. Firdaus F.");
            Console.WriteLine("NIM\t: 19.11.2789");
            Console.WriteLine("Kelas\t: IF03");

            Console.ReadKey();
        }
Esempio n. 7
0
        static void Main(string[] args)
        {
            Console.WriteLine("Nama\t: Sangaji");
            Console.WriteLine("NIM\t: 19.11.2730");
            Console.WriteLine("Kelas\t: 19 IF 03");

            Console.WriteLine();

            Console.WriteLine("Pilih Printer: \n1. Epson\n2. Canon\n3. LaserJet");

            Console.Write("\nNomor Printer [1 ... 3] : ");
            int pilihPrinter = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine();

            IPrinterWindows printer = new PrinterWindows();

            if (pilihPrinter > 0 && pilihPrinter < 4)
            {
                if (pilihPrinter == 1)
                {
                    printer = new Epson();
                }
                else if (pilihPrinter == 2)
                {
                    printer = new Canon();
                }
                else
                {
                    printer = new LaserJet();
                }
            }
            else
            {
                Console.WriteLine("Pilihan tidak valid \n");
            }

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

            Console.ReadKey();
        }
Esempio n. 8
0
        static void Main(string[] args)
        {
            Console.WriteLine("Nama : Khias Nurlatif Ari Subekti");
            Console.WriteLine("NIM  : 19.11.2776");
            Console.WriteLine("Kelas: IF 03\n");

            IPrinterWindows printer = new PrinterWindows();

printerNumberInput:
            Console.WriteLine("Choose a Printer: ");
            Console.WriteLine("1. Epson");
            Console.WriteLine("2. Canon");
            Console.WriteLine("3. LaserJet");

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

            if (printerNumber == 1)
            {
                printer = new Epson();
            }
            else if (printerNumber == 2)
            {
                printer = new Canon();
            }
            else if (printerNumber == 3)
            {
                printer = new LaserJet();
            }
            else
            {
                Console.WriteLine("Sorry. The number you input has not been recorded. Please try again.\n");
                goto printerNumberInput;
            }

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

            Console.ReadKey();
        }
        static void Main(string[] args)
        {
            Console.WriteLine("Rafif Fauzan Almahdy | 19.11.2750 \n");


            IPrinterWindows printer = new PrinterWindows();

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

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

            if (nomorPrinter == 1)
            {
                printer = new Epson();
            }
            if (nomorPrinter == 2)
            {
                printer = new Canon();
            }
            else if (nomorPrinter == 3)
            {
                printer = new LaserJet();
            }
            else
            {
                Console.WriteLine("Error : Pilihan Tidak Ada");
            }

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

            Console.ReadKey();
        }
Esempio n. 10
0
        static void Main(string[] args)
        {
            Console.WriteLine("Nama \t: Naima Zulfa");
            Console.WriteLine("NIM \t: 19.11.2735");
            Console.WriteLine("Kelas \t: 19 IF 03\n");

            IPrinterWindows printer;

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

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

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