A ParcelLocker class is designed with a state machine diagram that has 5 states and 6 events. The diagram draws 9 transition arrows. In exactly two places, a pair of arrows leaves the same state on the same event with complementary guards. Every other arrow is the only one for its state and event. The team's policy is that any state-event combination with no drawn transition throws IllegalStateException. How many state-event combinations fall under this policy? Give your answer as a whole number.
Unlock full course notes by signing up
Reviewing a guarded withdrawal against its state machine
An Account state machine has states ACTIVE and FROZEN, and a new account starts in ACTIVE. The diagram draws a self-transition on ACTIVE for withdraw(amt), guarded by amt ≤ balance, with the action of subtracting amt from balance. It also draws ACTIVE to FROZEN on freeze and FROZEN to ACTIVE on unfreeze. Neither state has entry or exit actions. The team's policy is that an event with no transition from the current state throws IllegalStateException. When the guard of a drawn transition fails, the team throws IllegalArgumentException and leaves the balance and state unchanged. Review this implementation, in which the constructor sets the opening balance and freeze and unfreeze already follow the diagram and the policy:
Which statements about this withdraw method are true? Select all that apply.