Advertisement
InasAwad

Untitled

Sep 16th, 2020
668
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.33 KB | None | 0 0
  1. public int printPages(int pages) {
  2.             int pagesToPrint = pages;
  3.             if (this.duplex) {
  4.                 pagesToPrint = (pages / 2) + (pages % 2);
  5.                 System.out.println("Printing in duplex mode");
  6.             }
  7.             this.pagesPrinted += pagesToPrint;
  8.             return pagesToPrint;
  9.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement