What's the point of needing to type anything else after the loop has completed its three iterations? At that point you've already got solutions for the possible elements of the array to address...unless you want to be able to re-address a particular element more than once?
In that case, by far the easiest way would be to have a separate code to terminate the while instead of trying to make double use of the keys--
prompt='enter names ';
display('go again for enter d correct name ')
prompt='enter names ("x" to eXit)';
if complete & d=='x', break,end
break works above because now is not inside nested loop construct but outer loop.
Note that it also now will not allow the user to quit before the number of loop counter is done other than by Ctrl-C--once on the track, they've committed to ride until the train reaches the station.
Now the question is whether it is mandatory the user enter one of the allowable options or not...if that is required (not above nor in your initial code nor problem definition), then you should test the input and accept/reject the user response at that point instead.
If there is such a short list of possible answers, perhaps using a check box or dropdown list might be alternative instead of typing--makes the possible selection required to be in the allowable universe automagically.