Practice · 2 of 4
State machine: the register
CHALLENGE
Difficulty: beginner+25 XP
Implement Register.spend(int c) to spec: if c fits in the balance, subtract it and return true; otherwise change nothing and return false.
Press Submit to check your solution.
Back to lesson: Practice: Integrated reps