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(); }
static void Main(string[] args) { PrinterWindows 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()); Console.WriteLine(); if (nomorPrinter == 1) { printer = new Epson(); } else if (nomorPrinter == 2) { printer = new Canon(); } else if (nomorPrinter == 3) { printer = new LasjerJet(); } 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(); }
public void Show(PrinterWindows show) { Console.WriteLine("Epson printer printing...."); }
public void Print(PrinterWindows print) { Console.WriteLine("\nEpson display dimension : 10*11"); }
public void Print(PrinterWindows print) { Console.WriteLine("Epson Printer printing. . ."); }
public void Show(PrinterWindows show) { Console.WriteLine("Epson diplay dimension : 10*11"); }
public void Show(PrinterWindows show) { Console.WriteLine("Canoon diplay dimension : 9.5*12"); }
public void Print(PrinterWindows print) { Console.WriteLine("\nCanon display dimension : 9.5*12"); }
public void Print(PrinterWindows print) { Console.WriteLine("LaserJet printer printing...."); }
public void Show(PrinterWindows show) { Console.WriteLine("\nLaserJet display dimension : 12*12"); }