I need to create a java program that validates passwords entered into it. The password entered must match the specific pattern using a single regex statement. It must follow the exact order of 1 or more upper case letters, two lower case letters, 1 or 2 digits, zero or 1 upper case letters and any 2 of these symbols @#$%^& The output should say "Please enter a password:" If the password is wrong then it should say "Please try again. The password should have 1 or more upper case letters, two lower case letters, 1 or 2 digits, zero or 1 upper case letter and 2 symbols @#$%^&." If the password matches everything then it should say "Your password matches the pattern needed." If it's valid, it should end the loop. If it's invalid, it should continue to loop until it's valid.
Addition of Two Numbers
Adding two numbers in programming is essentially the same as adding two numbers in general arithmetic. A significant difference is that in programming, you need to pay attention to the data type of the variable that will hold the sum of two numbers.
C++
C++ is a general-purpose hybrid language, which supports both OOPs and procedural language designed and developed by Bjarne Stroustrup. It began in 1979 as “C with Classes” at Bell Labs and first appeared in the year 1985 as C++. It is the superset of C programming language, because it uses most of the C code syntax. Due to its hybrid functionality, it used to develop embedded systems, operating systems, web browser, GUI and video games.
I need to create a java program that validates passwords entered into it. The password entered must match the specific pattern using a single regex statement. It must follow the exact order of 1 or more upper case letters, two lower case letters, 1 or 2 digits, zero or 1 upper case letters and any 2 of these symbols @#$%^&
The output should say
"Please enter a password:"
If the password is wrong then it should say "Please try again. The password should have 1 or more upper case letters, two lower case letters, 1 or 2 digits, zero or 1 upper case letter and 2 symbols @#$%^&."
If the password matches everything then it should say
"Your password matches the pattern needed."
If it's valid, it should end the loop. If it's invalid, it should continue to loop until it's valid.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
This didn't answer the question at all. It's suppose to be a loop for invalid until they get it correct. Yours does not loop