Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

At a large US university, student account passwords must be 8 characters in leng

ID: 3669465 • Letter: A

Question

At a large US university, student account passwords must be 8 characters in length. They can contain lower case letters {a, b,..., z}, upper case letters {A, B,..., Z}, and numbers {0,1,..., 9} only. Each password must contain at least one lower case letter, at least one upper case letter, and at least one number. How many passwords are possible in this system? You can leave your answer as an unsimplified algebraic expression involving binomial coefficients, factorials, or exponents. You do not need to simplify, but leading to your answer.

Explanation / Answer

Must be eight characters Long: You do not need a regex for this. Using the .Length property should be enough.

Including one uppercase letter: You can use the [A-Z]+ regular expression. If the string contains at least one upper case letter, this regular expression will yield true.

One special character: You can use either the W which will match any character which is not a letter or a number or else, you can use something like so [!@#] to specify a custom list of special characters. Note though that characters such as $, ^, ( and ) are special characters in the regular expression language, so they need to be escaped like so: $. So in short, you might use the W.

Alphanumeric characters: Using the w+ should match any letter and number and underscore.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote