Briefly explain the state diagram by taking one example.
State Diagram - An object can be given a sequence of input instructions. The state of the object can vary depending upon sequence of input instructions. If we draw a diagram that will represent all processes (input) and their output (states), then that diagram is called as state diagram. Processes are represented by arrow symbol and states by the oval symbol. Such as, screen of ATM machine has many states like main screen state, process transaction state, request password state etc.