Skip to content

OOP: Elevator Design

Mani Bhushan edited this page Sep 6, 2016 · 5 revisions

Design an elevator control system

Interfaces:
-----------------
IElevator:
+ moveUp();
+ moveDown();
+ addDestination();

+ ElevatorStatus status();
+ ElevatorDirection direction();
---------------------

IElevatorControl:
+ pickUp(Integer pickUpFloor);
+ destination(Integer elevatorId, Integer destinationFloor);
+ step();
Enums:
ElevatorStatus:
+ ELEVATOR_BUSY,
+ ELEVATOR_FREE;
-----------------------

ElevatorDirection:
+ ELEVATOR_UP,
+ ELEVATOR_DOWN,
+ ELEVATOR_HOLD;

Clone this wiki locally