package references;

/**
 * A simple mechanism for tallying things.
 * modified from references lab by Samuel Rebelsky  
 */
public class Tally
{
  /**
   * The current value of the tally.
   */
  int val;

  /**
   * Build a new tally with value 0.
   */
  public Tally()
  {
    this.val = 0;
  } // Tally()

  public Tally(int start)
  {
    this.val = start;
  } // Tally()

  /**
   * Get the value of the tally.
   */
  public int get()
  {
    return this.val;
  } // get()

  /**
   * Tally something.
   */
  public void tally()
  {
    ++this.val;
  } // tally()

    /**
     * translate to a string format
     */
    public String toString ()
    {
        return Integer.toString (this.val);
    } // toString
} // class Tally
