You don't need an algorithm for an announcement. If the elevator has satisfied the requirement by stopping at the requested floor, just add code to play a .wav file announcing the floor before the door opens.