public static void main(String[] args) {
int i,couter1=0,couter2=0;
String str;
System.out.print("Enter a String : ");
str = Console.readString();
if(str.length()>=8){ //Length Word Input > 8
int word1=str.indexOf("computer");
int word2=str.indexOf("mut");
if(word1>=0||word2>=0){//check word not have computer or mut
System.out.println("Weak Password");
}
else{
for(i=0;i
couter1++;
}
else
if(str.charAt(i)>='0'&&str.charAt(i)<='9'){
couter2++;
}
}
if(couter1==str.length()||couter2==str.length()){
System.out.println("Weak Password");
}
else
System.out.println("Good Password");
}
}
else //Length Word Input < 8
System.out.println("Weak Password");
/* +++++++++++++++ Test Couter +++++++++++++++++++++ */
//System.out.println("Couter1: "+couter1);
//System.out.println("Couter2: "+couter2);
}
}
No comments:
Post a Comment