subject

Some websites impose certain rules for passwords. Suppose the password rules are as follows: 1. A password must have at least eight characters.
2. A password must consist of only letters and digits.
3. A password must contain at least two digits.
Write a program that prompts the user to enter a password and displays valid password if the rules are followed or invalid password otherwise. Create three methods (headers given below) to check the three rules.
public static boolean AtLeast8(String p)
public static boolean LetterOrDigit(String p)
public static boolean AtLeast2Digits(String p)
For example, method AtLeast8 will return true if there are at least eight characters in the password otherwise it will return false. The password is passed to the string variable p in this method. Inside the method do the following. Here are four sample runs:
Sample 1
1) Enter your password: My password18
Invalid password
Sample 2
Enter your password: pass18
Invalid password
Sample 3
Enter your password: password
Invalid password
Sample 4
Enter your password: password18
Valid password
Create a method AtLeast8 outside the main method with the header provided in the problem description.
i) If the length of p is less than 8 then return false, otherwise return true.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 08:50
Can online classes such as gradpoint track your ip location like if im taking a final and i give somebody else my account and they take the final for me will it show where they are taking the final from? and can this be countered with a vpn
Answers: 1
question
Computers and Technology, 22.06.2019 19:00
The fourth generation of computers emerged between 1970s and 1980s. which technological advancement brought about this generation of computers? which computer architecture was used most in this generation?
Answers: 3
question
Computers and Technology, 22.06.2019 21:30
Nathan wants to create multiple worksheet containing common formatting styles for his team members. which file extension him to save these worksheets? nathan to create multiple worksheets with common styles. he needs to save them with the extension.
Answers: 1
question
Computers and Technology, 22.06.2019 23:30
Select all that apply. which of the following are proofreading options included in microsoft word? spell check find replace grammar check formatting check
Answers: 1
You know the right answer?
Some websites impose certain rules for passwords. Suppose the password rules are as follows: 1. A p...
Questions
question
Social Studies, 23.01.2021 06:20
question
Mathematics, 23.01.2021 06:20
question
Chemistry, 23.01.2021 06:30
question
Mathematics, 23.01.2021 06:30
question
Social Studies, 23.01.2021 06:30
Questions on the website: 13722362