Question: Write a console program named UniqueNames that asks the user for a list of names (one per line) until the user enters a blank line

Write a console program named UniqueNames that asks the user for a list of names (one per line) until the user enters a blank line (i.e., just presses Enter when asked for a name). At that point the program should print out the list of names entered, where each name is listed only once (i.e., uniquely) no matter how many times the user entered the name in the program. For example, your program should behave as follows:

Enter name: Alice Enter name: Bob Enter name: Alice Enter name: Alice Enter name: Alice Enter name: Bob Unique name list contains: Alice Bob 

Make sure to not write a whole class, only write one method

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!