computeChange function

int computeChange(
  1. int dueCents,
  2. int tenderedCents
)

Implementation

int computeChange(int dueCents, int tenderedCents) {
  final rest = tenderedCents - dueCents;
  return rest < 0 ? 0 : rest;
}