Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Database Programming

Authors: Chris Fehily

1st Edition

1937842312, 978-1937842314

Students also viewed these Databases questions

Question

What factors infl uence our perceptions?

Answered: 1 week ago

Question

What are the classifications of Bank?

Answered: 1 week ago

Question

2 The main characteristics of the market system.

Answered: 1 week ago