START
Initialize an empty list to store names
PRINT "Enter names one by one. Type 'done' when finished."
WHILE True:
Prompt the user to enter a name
GET user_input
IF user_input is 'done':
BREAK
Append user_input to the list of names
IF list is not empty:
Sort the list of names alphabetically
first_name = names[0] // The first name in the sorted list
last_name = names[-1] // The last name in the sorted list
PRINT "First name alphabetically: ", first_name
PRINT "Last name alphabetically: ", last_name
ELSE:
PRINT "No names were entered."
END