package class6_3_ComputerBuilder; public class ComputerBuilderApp { public static void main(String[] args) { Component computer = new Composite("Computer"); Component monitor = new Part("Monitor 17 Inch", 200); Component desktop = new Composite("Desktop", 300); Component spinners = new Part("chrome spinner", 20 ); Component neonPowerSupply = new Composite("Neon Power", 75 ); Component yellowTube = new Part("Yellow light", 15); Component greenTube = new Part("Green light", 15); computer.add(monitor); computer.add(desktop); System.out.println("Price of the Computer = " + computer.getPrice()); desktop.add(spinners); spinners.add(neonPowerSupply); neonPowerSupply.add(yellowTube); neonPowerSupply.add(greenTube); desktop.add(neonPowerSupply); System.out.println("Price of the Computer = " + computer.getPrice()); Component wiFiConnectivity = new Composite("WiFi Connectivity"); Component blueTooth = new Part("BlueTooth", 10.50); Component basicWiFi = new Part("Basic WiFi", 45.50); wiFiConnectivity.add(blueTooth); wiFiConnectivity.add(basicWiFi); computer.add(wiFiConnectivity); System.out.println("Price of the Computer after Wifi upgrades = " + computer.getPrice()); } } /* Component monitor = new Part("Monitor 17 Inch", 200); Component desktop = new Composite("Desktop", 300); computer.add(monitor); computer.add(desktop); System.out.println("Price of the Computer = " + computer.getPrice()); Component wiFiConnectivity = new Composite("WiFi Connectivity"); Component blueTooth = new Part("BlueTooth", 10.50); Component basicWiFi = new Part("Basic WiFi", 45.50); wiFiConnectivity.add(blueTooth); wiFiConnectivity.add(basicWiFi); computer.add(wiFiConnectivity); System.out.println("Price of the Computer after Wifi upgrades = " + computer.getPrice()); */