Esempio n. 1
0
  public void turnOff() {
    System.out.println("System is shutting down");

    powerOn = false;
    cdrom.turnOff();
    hdd.turnOff();
    ram.turnOff();
    cpu.turnOff();
  }
Esempio n. 2
0
  public void turnOn() {
    powerOn = true;
    cpu.turnOn();
    ram.turnOn();
    hdd.turnOn();
    cdrom.turnOn();

    System.out.println("System is ready");
  }
Esempio n. 3
0
  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");
    }
  }