change method

int change(
  1. int v
)

Implementation

int change(int v) {
  int target = current + v;
  if (target > 100) {
    target = 100;
  }
  if (target < 0) {
    target = 0;
  }
  return target;
}