+ 1

Please i need help with this code

import java.util.*; public class Program { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String password = scan.nextLine(); char[] chars = password.toCharArray(); int countN = 0; int countC = 0 ; boolean valid = false; boolean isLong = false ; if (chars.length>=7){ isLong =true ; for(int i = 0 ; i<chars.length;i++ ){ if(chars [i]>=0 ) { countN++ ; if (chars[i] =='@' || chars[i] == '!' || chars[i] == '#' || chars[i] == '

#x27; || chars[i] == '%' || chars[i] == '*'){ countC++; } } } if(countN >=2 && countC >=2) valid = true ; } else System.out.println("Weak") ; if(valid && isLong ) System.out.println("Strong") ; else System.out.println("Weak") ; } }

16th Mar 2021, 9:01 PM
‎Abdul Jalil
‎Abdul Jalil - avatar
4 Answers
+ 1
Doggo , estas mamadisimo xd
17th Mar 2021, 2:37 AM
Misael Meriles
Misael Meriles - avatar
0
It doesn't work with the validation password challenge the excercise is to check a password if it's consist at least 7 carracters including at least 2 numbers and 2 specific characters
17th Mar 2021, 7:37 AM
‎Abdul Jalil
‎Abdul Jalil - avatar
17th Mar 2021, 7:42 AM
‎Abdul Jalil
‎Abdul Jalil - avatar