Computers and Technology

You have been asked to write a username validation program for a small website. The website has specific rules on what constitutes a valid username, including:

All usernames must be between 8 and 15 characters long

Usernames can only contain alphabetic (a-z and A-Z) and numeric characters (0-9) - no special characters are allowed.

The first character in a username cannot be a digit

Usernames must contain at least one uppercase character

Usernames must contain at least one lowercase character

Usernames must contain at least one numeric character

Write a program that asks the user to enter in a username and then examines that username to make sure it complies with the rules above. Here's a sample running of the program - note that you want to keep prompting the user until they supply you with a valid username:

Please enter a username: foo
Username must be between 8 and 15 characters.

Please enter a username: f
Username must be between 8 and 15 characters.

Please enter a username: foo ooo ooo
Username must contain only alphanumeric characters.

Please enter a username: f
Your username must contain at least one digit

Please enter a username: 1f
The first character in your username cannot be a digit

Please enter a username: f1
Your username must contain at least one uppercase character

Please enter a username: F1
Your username is valid!

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 17:00, juandguardado7045
Your company has 1,500 desktop computers running windows 7. you want to upgrade them to windows 10. which type of microsoft license would be best suited in this situation?
Answers: 3
image
Computers and Technology, 22.06.2019 19:20, manny2085
Amedian in the road will be marked with a white sign that has a black arrow going to the left of the median. true false
Answers: 1
image
Computers and Technology, 23.06.2019 14:30, ahmedeldyame
Select the correct answer. which step can possibly increase the severity of an incident? a. separating sensitive data from non-sensitive data b. immediately spreading the news about the incident response plan c. installing new hard disks d. increasing access controls
Answers: 2
image
Computers and Technology, 24.06.2019 10:30, johngayden46
This device directs network traffic. bridge hub nic repeater router switch
Answers: 3
Do you know the correct answer?
You have been asked to write a username validation program for a small website. The website has spec...

Questions in other subjects:

Konu
Mathematics, 08.04.2021 18:20
Konu
Physics, 08.04.2021 18:20
Konu
Mathematics, 08.04.2021 18:20