Need help with your Discussion

Get a timely done, PLAGIARISM-FREE paper
from our highly-qualified writers!

glass
pen
clip
papers
heaphones

UMBC Username and Password Validator Program Project

UMBC Username and Password Validator Program Project

UMBC Username and Password Validator Program Project

Description

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 or spaces are allowed.
  • The first and last characters 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. User input is underlined:

Enter a username: foobar
* Length of username: 6
  ERROR - username must be between 8 and 15 characters long
* All characters are alphabetic or numeric: True
* First character is a digit: False
* Last character is a digit: False
* # of uppercase characters: 0
  ERROR - username must contain at least one uppercase character
* # of lowercase characters: 6
* # of digit characters: 0
  ERROR - username must contain at least one digit character
Username is not valid, please try again

Enter a username: FOOBAR5
* Length of username: 7
  ERROR - username must be between 8 and 15 characters long
* All characters are alphabetic or numeric: True
* First character is a digit: False
* Last character is a digit: True
  ERROR - last character cannot be a digit
* # of uppercase characters: 6
* # of lowercase characters: 0
  ERROR - username must contain at least one lowercase character
* # of digit characters: 1
Username is not valid, please try again

Enter a username: FooBar5
* Length of username: 7
  ERROR - username must be between 8 and 15 characters long
* All characters are alphabetic or numeric: True
* First character is a digit: False
* Last character is a digit: True
  ERROR - last character cannot be a digit
* # of uppercase characters: 2
* # of lowercase characters: 4
* # of digit characters: 1
Username is not valid, please try again

Enter a username: FooFooFoo
* Length of username: 9
* All characters are alphabetic or numeric: True
* First character is a digit: False
* Last character is a digit: False
* # of uppercase characters: 3
* # of lowercase characters: 6
* # of digit characters: 0
  ERROR - username must contain at least one digit character
Username is not valid, please try again

Enter a username: Foo999Bar
* Length of username: 9
* All characters are alphabetic or numeric: True
* First character is a digit: False
* Last character is a digit: False
* # of uppercase characters: 2
* # of lowercase characters: 4
* # of digit characters: 3
Username is valid!

Hint: you will need to count the # of uppercase, lowercase and digit characters using some kind of loop.

Part 1a is an intermediate step towards the final version of this program. You do not need to turn in this part of the program – keep working and turn in part 1b when you are finished. You only need to turn in part 1b.

Part 1b: Password Validator

This is a solo project. You may start working in your Ed workspace as a group to help each other out, but after class everyone should download any work written by the group and continue working locally on their own computer. You will be doing yourself a HUGE disservice by not working on this project by yourself! If you do share tips with one another please be sure to include everyone’s name at the top of your program. Note that “sharing tips” does not mean “copied the entire program” from someone else.

  • Passwords must be at least 8 characters long (but they do not have an upper limit)
  • Passwords cannot contain the user’s username (i.e. if the username is “My1stUsername” the password cannot be “abcMy1stUsername” or “My1stUsernameABC” because the username String can be found in the password String)
  • Passwords must be a mixture of uppercase letters (A-Z), lowercase letters (a-z), digits (0-9) and a select number of special characters (#, $, % and !). The password must contain at least one of each of these types of characters in order to be valid.

You can make a copy of Part 1a and place your password validator code directly after your username validator. Here’s a sample running of the program. Note that you need to continually ask the user for a password until they supply a good one.

Enter a username: Abc123def
* Length of username: 9
* All characters are alphabetic or numeric: True
* First character is a digit: False
* Last character is a digit: False
* # of uppercase characters: 1
* # of lowercase characters: 5
* # of digit characters: 3
Username is valid!

Enter a password: apple
* Length of password: 5
  ERROR - password must be at least 8 characters long
* Username is part of password: False
* # of uppercase characters in the password: 0
  ERROR - password must contain at least one uppercase character
* # of lowercase characters in the password: 5
* # of digit characters in the password: 0
  ERROR - password must contain at least one digit character
* # of special characters in the password: 0
  ERROR - password must contain at least one special character
* # of invalid characters in the password: 0
Password is no valid, please try again

Enter a password: APPLE
* Length of password: 5
  ERROR - password must be at least 8 characters long
* Username is part of password: False
* # of uppercase characters in the password: 5
* # of lowercase characters in the password: 0
  ERROR - password must contain at least one lowercase character
* # of digit characters in the password: 0
  ERROR - password must contain at least one digit character
* # of special characters in the password: 0
  ERROR - password must contain at least one special character
* # of invalid characters in the password: 0
Password is no valid, please try again

Enter a password: Abc123def
* Length of password: 9
* Username is part of password: True
  ERROR - username cannot exist within password
* # of uppercase characters in the password: 1
* # of lowercase characters in the password: 5
* # of digit characters in the password: 3
* # of special characters in the password: 0
  ERROR - password must contain at least one special character
* # of invalid characters in the password: 0
Password is no valid, please try again

Enter a password: ZZZAbc123def
* Length of password: 12
* Username is part of password: True
  ERROR - username cannot exist within password
* # of uppercase characters in the password: 4
* # of lowercase characters in the password: 5
* # of digit characters in the password: 3
* # of special characters in the password: 0
  ERROR - password must contain at least one special character
* # of invalid characters in the password: 0
Password is no valid, please try again

Enter a password: Abc123defZZZ
* Length of password: 12
* Username is part of password: True
  ERROR - username cannot exist within password
* # of uppercase characters in the password: 4
* # of lowercase characters in the password: 5
* # of digit characters in the password: 3
* # of special characters in the password: 0
  ERROR - password must contain at least one special character
* # of invalid characters in the password: 0
Password is no valid, please try again

Enter a password: abc123defZZZ
* Length of password: 12
* Username is part of password: False
* # of uppercase characters in the password: 3
* # of lowercase characters in the password: 6
* # of digit characters in the password: 3
* # of special characters in the password: 0
  ERROR - password must contain at least one special character
* # of invalid characters in the password: 0
Password is no valid, please try again

Enter a password: helloWorld123
* Length of password: 13
* Username is part of password: False
* # of uppercase characters in the password: 1
* # of lowercase characters in the password: 9
* # of digit characters in the password: 3
* # of special characters in the password: 0
  ERROR - password must contain at least one special character
* # of invalid characters in the password: 0
Password is no valid, please try again

Enter a password: helloWorld123***
* Length of password: 16
* Username is part of password: False
* # of uppercase characters in the password: 1
* # of lowercase characters in the password: 9
* # of digit characters in the password: 3
* # of special characters in the password: 0
  ERROR - password must contain at least one special character
* # of invalid characters in the password: 3
  ERROR - password cannot contain any invalid characters
Password is no valid, please try again

Enter a password: helloWorld123!
* Length of password: 14
* Username is part of password: False
* # of uppercase characters in the password: 1
* # of lowercase characters in the password: 9
* # of digit characters in the password: 3
* # of special characters in the password: 1
* # of invalid characters in the password: 0
Password is valid!

Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."

Order Solution Now

Our Service Charter


1. Professional & Expert Writers: Eminence Papers only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed of papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by Eminence Papers are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. Eminence Papers are known for the timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit in all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At Eminence Papers, we have put in place a team of experts who answer all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.

We Can Write It for You! Enjoy 20% OFF on This Order. Use Code SAVE20

Stuck with your Assignment?

Enjoy 20% OFF Today
Use code SAVE20