subject

Having a secure password is a very important practice, when much of our information is stored online. Write a program that validates a new password, following these rules: The password must be at least 8 characters long. The password must have at least one uppercase and one lowercase letter The password must have at least one digit. Write a program that asks for a password, then asks again to confirm it. Next, write a method: public static void check(String pw1, String pw2) If the passwords don’t match or the rules above are not fulfilled, print a message that the password is not valid. Here are some tips for checking the password: Use .equals() to compare two strings Use a loop to check each character of the password. In the loop, use Character. isDigit() to check if a character is a digit or not. Use Character. isUpperCase(nextChar) and Character. isLowerCase(nextChar) to check if a character is upper or lower case (where nextChar is the next current character in your password string). You could use flag variables to set if a digit, upper, and lowercase letter are found.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 09:00
The first screen you see when you open word2016 what is called?
Answers: 1
question
Computers and Technology, 23.06.2019 12:30
What is the difference between the internet and the world wide web?
Answers: 1
question
Computers and Technology, 24.06.2019 05:30
If you combine two cells into one, what action are you performing? a.  adding a new row or column      b.  splitting the cells      c.  removing a new row or column      d.  merging the cells
Answers: 2
question
Computers and Technology, 24.06.2019 14:30
Two students are discussing electricity that has a frequency of 60 hz. student a says that this type of electricity is referred to as ac. student b says that in this type of electricity, the electrons flow in only one direction. which of the following statements is correct? a. only student a is correct b. only student b is correct c. both of the two students are correct d. neither of the two students is correct
Answers: 1
You know the right answer?
Having a secure password is a very important practice, when much of our information is stored online...
Questions
question
French, 04.07.2021 01:20
question
Computers and Technology, 04.07.2021 01:30
question
Mathematics, 04.07.2021 01:30
question
Biology, 04.07.2021 01:30
Questions on the website: 13722361