A media player has three states. In Stopped, "play" moves to Playing. In Playing, "pause" moves to Paused and "stop" moves to Stopped. In Paused, "play" moves to Playing and "stop" moves to Stopped. Any other event leaves the state unchanged. The player starts in Stopped and the events are: play, pause, pause, play, stop. What is the final state?
- play: Stopped → Playing. pause: Playing → Paused.
- pause: there is no pause transition from Paused, so the state stays Paused.
- play: Paused → Playing. stop: Playing → Stopped.
Answer: Stopped (the state changed 4 times)