Implement the following to simulate how websites ensure that everyone has a unique username. a) Make a list of five or more usernames called current_users. b) Request an input of username. c) Print a message, Sorry XXX, that name is taken and also display the current user list if the input username has already been used. XXX is the input user name. d) Print a message, Great, XXX is still available and also display the updated user list if the username has not been used. e) Make sure your comparison is case insensitive. If 'John' has been used, 'JOHN' or ‘john’ should not be accepted. Example Output 1 Enter your user name: TOM Sorry TOM, that name is taken. Current users: [‘admin’, ‘tom’, ‘jerry’, ‘Dora’, ‘GEORGE’] Example Output 2 Enter your user name: curiousGeorge Great, curiousGeorge is still available. Updated users: [‘admin’, ‘tom’, ‘jerry’, ‘Dora’, ‘GEORGE’, ‘curiousGeorge’]

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter5: Looping
Section: Chapter Questions
Problem 12E
icon
Related questions
Question

Implement the following to simulate how websites ensure that everyone has a unique username.

a) Make a list of five or more usernames called current_users.

b) Request an input of username.

c) Print a message, Sorry XXX, that name is taken and also display the current user list if the input username has already been used. XXX is the input user name.

d) Print a message, Great, XXX is still available and also display the updated user list if the username has not been used.

e) Make sure your comparison is case insensitive. If 'John' has been used, 'JOHN' or ‘john’ should not be accepted.

Example Output 1

Enter your user name: TOM

Sorry TOM, that name is taken.

Current users: [‘admin’, ‘tom’, ‘jerry’, ‘Dora’, ‘GEORGE’]

Example Output 2

Enter your user name: curiousGeorge

Great, curiousGeorge is still available.

Updated users: [‘admin’, ‘tom’, ‘jerry’, ‘Dora’, ‘GEORGE’, ‘curiousGeorge’]

Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,