Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The following are the password rules used by a web site: A password must be at least 8 and no more than 32 characters
The following are the password rules used by a web site: A password must be at least 8 and no more than 32 characters in length. A password must contain at least one character from each of the following sets: Uppercase alphabet (A-Z) - Lowercase alphabet (a-z) - Number (0-9) and special characters (such as # @ $ &) A password may not begin or end with the space character. A password may not contain more than two consecutive identical characters. A password may not be (or be a variation of) a dictionary word in English or many other languages. This includes making simple substitutions of digits or punctuation that resemble alphabetic characters. In specific, 0 (for o), 1 (for 1), and $ (for s). The length of the password is at least 5 characters longer than a dictionary word. Passwords should not contain: carriage return (ASCII 13, '), linefeed (ASCII 10, \f'), /, \, or a trailing symbol). You will complete the following methods in CheckPasswords.java: static int countUppercaseLetters (String password) Count the number of uppercase letters in password and returns the count; can assume only ASCII characters. Returns the number of upper case letters. For example, if password is ABC2928fh, it returns 3. static int countLowercaseLetters (String password) Count the number of lowercase letters in password and returns the count; can assume only ASCII characters. For example, if password is ABC2928fh, it returns 2. static int longest Consecutive Identical Characters (String password) Count the longest sequences of consecutive identical characters; can assume only ASCII characters. Returns the maximum repeat count. For example, given the password helloworld, this method returns 2. Similarly, for aabaaaahd, it returns 4. static boolean similarToWord (String word, String password) Check to see if a password is to similar to a dictionary word. It is too similar if the dictionary word (the first parameter) is contained in the password (the second parameter) when ignoring case and treating '1' and 'l' as identical, 'o' and '0' as identical, and 's' and '$' as identical, and the length of the password is at least 5 characters longer than the word. For example, if galaxy is the value of word and galaxy1234 is the value of password, this method returns true, but it returns false for galaxy12345. static boolean checkPassword (String password, String[] dictionary) Check to see if password, given as a parameter, conforms to the password rules described above. It returns false if the password does not conform to any of the rules. Otherwise it returns true. You will also complete the following method in PasswordGenerator.java: static String generatePassword (int wordCount, Random r, String[] words) Generate a password from the list of words provided. The password should be concatenation of wordCount number of words, and no word should be repeated more than once. Format the code clearly with blank lines, spacing and indents Use self-documenting, meaningful variable names Use variable names that begin with lower case and then camel case (e.g., roomTemp if two words Use capital letters (e.g., ALL_CAPS) for variables that encodes constant values that aren't updated Use appropriate comments that indicate what a section, or a complicated line, does
Step by Step Solution
★★★★★
3.25 Rating (151 Votes )
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started