import java.util.Scanner;
public class Password3 {
public static void main(String[] args) {
int min =8;
int max=16;
int digit=0;
int special=0;
int upCase=0;
int loCase=0;
String password;
Scanner sc = new Scanner(System.in);
System.out.println(" Enter Your Password:");
password = sc.nextLine();
for(int i =0;i<password.length();i++){
if(password.length()>=min&&password.length()<=max){
char c = password.charAt(i);
if(Character.isUpperCase(c)){
upCase++;
}
if(Character.isLowerCase(c)){
loCase++;
}
if(Character.isDigit(c)){
digit++;
}
if(c>=33&&c<=46||c==64){
special++;
}
}
}
if(special>=1&&loCase>=1&&upCase>=1&&digit>=1){
System.out.println(" Password is perfectly match you can procced:" +password);
}
else{
if(password.length()<min){
System.out.println("1. Password must be atleat "+min+" characters:");
}
if(password.length()>max){
System.out.println("2. Password must be less than "+max+" characters:");
}
if(special<1){
System.out.println("3. You need atleast one special chracter:");
}
if(digit<1){
System.out.println("4. You need atleast one digit:");
}
if(upCase<1){
System.out.println("5. You need atleast one upper case:");
}
if(loCase<1){
System.out.println("6. You need atleast one lower case:");
}
}
}
}
-
Featured
5. C program to create a TCP socket in which multiple client can communicate to each other through a single server
Her under these version of our post we are going to create a socket program in which two client can communicate to each other through a single server . Just it mean that we are creating a socket program for a simple chat like facebook , messenger and other with any coast. lets see the… Read more
-
Different Types of Patterns in shell script
Welcome back!!!! Her in this version of our post we are going to see some tricky patterns in linux shell script or bash programming. I hope the code I have made for this pattern program is surly written in easy way for beginner as well as professional. This post included some of the most tricky… Read more
-
6. C program to create a TCP socket in which three clients communicate to each other through a single server.
In our previous post we have seen how two client can communicate to each other through a single server. But now upgrading the same concept we are going to see how three client can communicate to each other . In these post I am going to show you a TCP socket in which two client… Read more
Follow My Blog
Get new content delivered directly to your inbox.