public Motherboard(string manufacturer) { this.manufacturer = manufacturer; processor = new CPU(); tempMemory = new RAM(); storage = new HardDrive(); graphics = new GPU(); }
// constructor public Computer() { cpu = new CPU("Intel", "i5-8265U"); ram = new RAM(12, "Samsung"); gpu = new GPU("Nvidia", 32); hardDrive = new HardDrive(256, 256); motherboard = new Motherboard("Intel", ram, cpu, hardDrive, gpu); }
public Motherboard(string manufacturer, RAM ram, CPU cpu, HardDrive hardDrive, GPU gpu) { Manufacturer = manufacturer; TemporaryMemory = ram; Processor = cpu; Storage = hardDrive; Graphics = gpu; }
// constructor public Motherboard(string manufacturer, RAM ram, CPU cpu, HardDrive hardDrive, GPU gpu) { this.manufacturer = manufacturer; temporaryMemory = ram; processor = cpu; storage = hardDrive; graphics = gpu; }
// Member methods public bool ProcessInstall(Applications app, HardDrive hardDrive, RAM ram, GPU gpu) { bool installOK = CheckRequirements(app, hardDrive, ram, gpu); if (installOK) { hardDrive.applicationsInHardDrive.Add(app); hardDrive.availableStorage -= app.requiredStorage; } return(installOK); }
//member methods public void CheckRequirements(Applications app, HardDrive hardDrive, RAM ram, GPU gpu) { if (ram.TotalGigabytes > app.RequiredRAM && hardDrive.AvailableStorage > app.RequiredStorage) { hardDrive.ProcessInstall(app, hardDrive, ram, gpu); } else { Console.WriteLine("Does not meet installation requirements"); } }
public void BuildComputer() { GPU gpu = new GPU("Dell", 512); CPU cpu = new CPU("Dell", "Name"); HardDrive hardDrive = new HardDrive(1000.0, 950.0); RAM ram = new RAM(512, "Dell"); Motherboard motherboard = new Motherboard("Dell", ram, cpu, hardDrive, gpu); Games game = new Games("Solitaire", "Game", 20, 200, 6); cpu.CheckRequirements(game, hardDrive, ram, gpu); }
public bool CheckRequirements(Applications app, HardDrive hardDrive, RAM ram, GPU gpu) { bool rtn = false; if (ram.totalGigabytes >= app.requiredRAM && hardDrive.availableStorage >= app.requiredStorage && gpu.effectiveMemory >= app.GraphicsRequirement()) { rtn = true; } return(rtn); }
//member methods public void ProcessInstall(Applications app, HardDrive hardDrive, RAM ram, GPU gpu) { hardDrive.ApplicationsInHardDrive.Add(app); }