why not combine the getline above and the while loop? just change the prompt to be "Which algorithm ... 1) FCFS....5)..." and then in the loop "Please select a number between 1 to 5:" 

that way you enforce the 1-5 at the time of first input