Instructions

Write a program that works with a user's password. The program should prompt the user for a possible password. Your program should check to be sure this is a 'good' password. Specifically, a good password is one that has:

  • between 6 and 10 characters long
  • contains at least one letter
  • contains at least one digit

Continue to prompt the user for a password until these criteria are met. Once the user enters a 'good' password, prompt them to enter it again until the two passwords match.

Please note the way you'll write this program, the user will be able to see the characters that they type. While you wouldn't want to do this in practice, it's ok for our exercise here.

Be sure your program demonstrates good programming style (appropriate comments, identifier names, indenting, etc).

Although your output is not required to look this way, your output might look something like:

Please enter a possible password: password1
This is a good password. Please retype the password to confirm: password1
Your passwords match. Congratulations!

Another possible run of this program might look something like:

Please enter a possible password: me
This is not a good password. Please try again.
Please enter a possible password: meandyou2
This is a good password. Please retype the password to confirm:
meandyoutoo
This doesn't match your first entry. Please try again:
Please retype the password to confirm: meandyou
This doesn't match your first enter. Please try again:
Please retype the password to confirm: meandyou2
Your passwords match. Congratulations!
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.