Implement Elevator class. Requirements:
The Elevator:
- starts on the ground floor,
- can be in one of following states: "going up", "going down", "waiting", "need maintenance",
- closes doors after pushing button, after closing doors elevator starts the engine,
- after reaching requested floor the elevator stops and opens the doors,
- visits floors in proper order (if 4, 2, 5 were pushed, it should visit 2, 4, 5),
- maintain one direction (up/down) as long as possible,
- stops and goes into "need maintenance" state, in case of the engine failure,
- does not respond to any commands, in "need maintenance" state,
- goes into "need maintenace" state if it detects the floors sensor failure (e.g. the floors are visited out of order: 1, 3, 2).
Sample Solution can be found here: