Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class SecondLifeAccount2 {
- private String username;
- private String password;
- private int month;
- private int day;
- private int year;
- private String secretQuestion;
- private String secretAnswer;
- static int pos = 0;
- static int countU = 0;
- static int countL = 0;
- static int countD = 0;
- static int minChars = 6;
- static int maxChars = 16;
- public SecondLifeAccount2() {
- }
- public SecondLifeAccount2(String u, String pass, int m, int d, int y,
- String q, String a) {
- username = u;
- password = pass;
- month = m;
- day = d;
- year = y;
- secretQuestion = q;
- secretAnswer = a;
- }
- public static boolean goodPassword(String password) {
- if (password.length() >= minChars && password.length() <= maxChars) {
- while (pos < password.length()) {
- char letter = password.charAt(pos);
- pos++;
- if (Character.isUpperCase(letter)) {
- countU++;
- }
- if (Character.isLowerCase(letter)) {
- countL++;
- }
- if (Character.isDigit(letter)) {
- countD++;
- }
- if (password.length() >= minChars && password.length()
- <= maxChars && countU > 0 && countL > 0 && countD > 0) {
- return true;
- } else {
- return false;
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment