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

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

    System.out.println("System is ready");
  }
Example #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");
    }
  }