Exemplo n.º 1
0
        static void Main(string[] args)
        {
            monitor lgmonitor = new monitor("1200x600", true, 32);
            printer hpprinter = new printer("HP", "MP102", 50);

            vga       nvdiaVga       = new vga("Nvidia", 2054, 2054);
            ram       samsungRam     = new ram("DDR4", 5000, 8000);
            processor intelProcessor = new processor();

            intelProcessor.setCache(254);
            intelProcessor.setCore(8);
            intelProcessor.setSeries("CORE i7 8th Gen");

            computer computer = new computer.Builder(samsungRam, nvdiaVga, intelProcessor) //parameter wajib
                                .withMonitor(lgmonitor)                                    //parameter opsional
                                .withPrinter(hpprinter)                                    //parameter opsional
                                .build();

            Console.WriteLine(computer.ToString());
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            Monitor lgMonitor = new Monitor("1200x600", true, 32);
            printer hpprinter = new printer("HP", "MP102", 50);

            VGA       nvdiaVGA       = new VGA("Nvdia", 2045, 2054);
            RAM       samsungRAM     = new RAM("DDR4", 5000, 8000);
            Processor intelProcessor = new Processor();

            intelProcessor.setcache(254);
            intelProcessor.setcore(8);
            intelProcessor.setseries("CORE i7 8th Gen");

            Computer computer = new
                                Computer.Builder(samsungRAM, nvdiaVGA, intelProcessor)
                                .withMonitor(lgMonitor)
                                .withprinter(hpprinter)
                                .build();

            Console.WriteLine(computer.ToString());
        }
Exemplo n.º 3
0
 public Builder withPrinter(printer printer)
 {
     this.printer = printer;
     return(this);
 }