static void Main(string[] args) { Tampilkan tampil = new Tampilkan(); Mencetak cetak = new Mencetak(); 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(tampil); printer.Print(cetak); Console.ReadKey(); }
public void Show(Tampilkan tampil) { Console.WriteLine("Canon display dimension : 9.5*12 "); }
public void Show(Tampilkan tampil) { Console.WriteLine("Epson display dimension : 10*11 "); }
public void Show(Tampilkan tampil) { Console.WriteLine("LaserJet display dimension : 12*12 "); }