예제 #1
0
        static void Main(string[] args)
        {
            PrinterWindows printer = new PrinterWindows();

            Console.WriteLine("Pilihlah Printer :\n");
            Console.WriteLine("1.Epson");
            Console.WriteLine("2.Canon");
            Console.WriteLine("3.LaserJet\n");
            Console.WriteLine("Pilih Nomor Printer = ");
            //inputting integer for branching
            int Pilihan = Convert.ToInt32(Console.ReadLine());

            //all branching for suitable condition
            if (Pilihan == 1)
            {
                printer = new Epson();
            }
            else if (Pilihan == 2)
            {
                printer = new Canon();
            }
            else if (Pilihan == 3)
            {
                printer = new Laserjet();
            }
            else
            {
                Console.WriteLine("Opsi tidak tersedia");
            }

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

            Console.ReadKey();
        }
예제 #2
0
        static void Main(string[] args)
        {
            PrinterWindows printer;

            Console.WriteLine("Pilih Printer : ");
            Console.WriteLine("1. Epson");
            Console.WriteLine("2. Canon");
            Console.WriteLine("3. Laser Jet\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();
        }
예제 #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();
        }
        static void Main(string[] args)
        {
            //declaring the object printer that takes blueprint from PrinterWindows class
            PrinterWindows printer = new PrinterWindows();

            Console.WriteLine("Pilihlah Printer :\n");
            Console.WriteLine("1.Epson");
            Console.WriteLine("2.Canon");
            Console.WriteLine("3.LaserJet\n");
            Console.WriteLine("Pilih Nomor Printer = ");
            //inputting integer for branching
            int Pilihan = Convert.ToInt32(Console.ReadLine());

            //all branching for suitable condition
            if (Pilihan == 1)
            {
                printer = new Epson();
            }
            else if (Pilihan == 2)
            {
                printer = new Canon();
            }
            else if (Pilihan == 3)
            {
                printer = new Laserjet();
            }
            else
            {
                Console.WriteLine("Maaf, Opsi Tersebut Belum Tersedia :( Pakai Default Aja Ya :(");
            }
            //call all the method
            printer.show();
            printer.print();
            Console.ReadKey();
        }
예제 #5
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();
        }
예제 #6
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.WriteLine("Pilih Nomor 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();
        }
예제 #7
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();
        }
예제 #8
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();
        }
예제 #10
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();
        }