Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started