Esempio n. 1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello Manusia!");


            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());
        }
Esempio n. 2
0
 public Builder(Ram ram, VGA vga, Processor processor)
 {
     this.ram       = ram;
     this.vga       = vga;
     this.processor = processor;
 }
Esempio n. 3
0
 public Builder(Ram ram, Vga vga, Prosesor prosesor)
 {
     this.ram      = ram;
     this.vga      = vga;
     this.prosesor = prosesor;
 }