Example #1
0
  public void print(int copies) {
    checkCopies(copies);
    String onStatus = "";
    if (machine.isOn()) onStatus = " is On!";
    else onStatus = " is Off!";

    String textToPrint = modelNumber + onStatus;
    while (copies > 0 && !paperTray.isEmpty()) {
      System.out.println(textToPrint);
      copies--;
      paperTray.usePage();
    }
    if (paperTray.isEmpty()) System.out.println("Load more paper");
  }
Example #2
0
 public void loadPrinter(int count) {
   paperTray.addPaper(count);
 }