/**
 * A class to model printing or copy cards that store 
 * credits for future pages of printing. 
 * New cards start with no pages of printing.
 */
public class PrinterCard {
    private int pages = 0;

    /**
     * buy: increase the credits on this card by newPages  
     */ 
    public void buy(int newPages) {
        pages = pages + newPages;
    } 
  
    /**
     * print: print a single page which costs 1 credit
     */ 
    public void print() {
        pages = pages - 1;
    }  
 
 
    /**
     * getBalance: reports the available credits remaining on the card
     */ 
    public int getBalance() {
        return pages;
    }

} // class PrinterCard
