Function simulating single elevator movement
As a C++ learning exercise, you will benefit from creating an Elevator class in this case. Make it a class that has a the current floor and direction as a data members (those are the current states of the elevator), and a function PlanRoute that gets input floors as input, and returns the output floors.

The h-file will look something like this:

class Elevator {
public:
  Elevator();
  void setCurrentFloor(int currentFloor);
  void setDirection(bool goingDown);
  std::vector&lt;int&gt; planRoute(const std::vector&lt;int&gt;&amp; inputFloors)
private:
  bool goingDown;
  int currentFloor;
}