package counter;

public class Counter {
  private int count;

  public Counter() {
    count = 0;
  }

  public Counter(int initialCount) {
    count = initialCount;
  }

  // Increment count
  public void increment() {
    // count = count + 1;
    count += 1;
    // count++;
  }

  // Increment count by a value
  public void increment(int value) {
    // count = count + value;
    count += value;
    value = 0; // a useless statement
  }

  // Decrement count
  public void decrement() {
    // count = count - 1;
    count -= 1;
    // count--;
  }

  // Decrement count by a value
   public void decrement(int value) {
     // count = count - value;
     count -= value;
  }

  // accessor for count
  public int getCount() {
    return count;
  }

  // reset the counter
  public void reset() {
    count = 0;
  }

  // reset the counter to a given value
  public void reset(int resetValue) {
    count = resetValue;
  }

  public String toString() {
    return "Counter: count = " + count;
  }

}

