public void turnOff() { System.out.println("System is shutting down"); powerOn = false; cdrom.turnOff(); hdd.turnOff(); ram.turnOff(); cpu.turnOff(); }
public void turnOn() { powerOn = true; cpu.turnOn(); ram.turnOn(); hdd.turnOn(); cdrom.turnOn(); System.out.println("System is ready"); }
public void scanViruses() { if (this.powerOn != false) { String dataForScan = ram.read(); cpu.scanForVirus(ram, dataForScan); dataForScan = hdd.read(); cpu.scanForVirus(hdd, dataForScan); if (cdrom.isDiskInserted() == true) { dataForScan = cdrom.read(); cpu.scanForVirus(cdrom, dataForScan); } else { System.out.println("No disk in CDROM"); } } else { System.out.println("Before scan, turn on your PC"); } }