Example #1
0
        static void Main(string[] args)
        {
            PrinterWindows 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();
        }
Example #2
0
        static void Main(string[] args)
        {
            PrinterWindows printer;

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

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

            if (nomorPrinter == 1)
            {
                printer = new Epson("Epson", "10*11");
            }
            else if (nomorPrinter == 2)
            {
                printer = new Canon("Canon", "9.5*12");
            }
            else
            {
                printer = new LaserJet("LaserJet", "12*12");
            }

            printer.Tampilkan();
            Console.ReadKey();
        }
Example #3
0
        static void Main(string[] args)
        {
            Console.WriteLine("Nama \t: Hernanda Giri Pramudita");
            Console.WriteLine("NIM \t: 19.11.2761");
            Console.WriteLine("Prodi \t: Informatika 03");
            Console.WriteLine("");

            PrinterWindows 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
            {
                printer = new LaserJet();
            }

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

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

            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
            {
                printer = new LaserJet();
            }

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

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

            PrinterWindows 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());

            Console.WriteLine();

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

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

            Console.ReadKey();
        }
Example #6
0
        static void Main(string[] args)
        {
            Console.WriteLine("Nama \t: Merlita Amelia");
            Console.WriteLine("NIM \t: 19.11.2693");
            Console.WriteLine("Kelas \t: Informatika 02\n");

            PrinterWindows printer;

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

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

            Console.WriteLine("\n");

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

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

            Console.ReadKey();
        }
        static void Main(string[] args)
        {
printerNumberInput:
            PrinterWindows printer;

            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. Try again.");
                goto printerNumberInput;
            }

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

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

            PrinterWindows 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();
            }
            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();
        }