コード例 #1
0
 //member variables
 public void ProcessInstall(Applications app, HardDrive hardDrive, RAM ram)
 {
     //add app to the list on hard drive
     ram.totalGigabytes         -= app.requiredRam;
     hardDrive.availableStorage -= app.requiredStorage;
     hardDrive.applicationsInHardDrive.Add(app);
 }
コード例 #2
0
        //constructor
        public Motherboard(string manufacturer, CPU processor, RAM temporaryMemory, HardDrive hardDrive, GPU gpu)
        {
            Applications slack = new Applications("Slack", "Messaging Service", 4.0, 0.512);

            this.manufacturer    = manufacturer;
            this.processor       = processor;
            this.temporaryMemory = temporaryMemory;
            storage  = hardDrive;
            graphics = gpu;
        }
コード例 #3
0
        public bool CheckRequirements(Applications app, HardDrive hardDrive, RAM ram)
        {
            bool canRunProgram = false;

            if (hardDrive.availableStorage > app.requiredStorage && ram.totalGigabytes > app.requiredRam)
            {
                canRunProgram = true;
                Console.WriteLine("Your computer's hardware is sufficient to install and run the program.");
                return(canRunProgram);
            }
            else
            {
                canRunProgram = false;
                return(canRunProgram);
            }
        }