Commit a607aa3a authored by Ash's avatar Ash

New final

parent 7fad4431
...@@ -25,7 +25,7 @@ public class AssessmentPartTwo { ...@@ -25,7 +25,7 @@ public class AssessmentPartTwo {
// I's position is determined by what it equal to on this run through the code // I's position is determined by what it equal to on this run through the code
char letterScore = aWord.charAt(i); char letterScore = aWord.charAt(i);
//fix
//The switch statement is taking in the char letterScore and comparing into the case values //The switch statement is taking in the char letterScore and comparing into the case values
switch (letterScore) { switch (letterScore) {
case 'a': case 'a':
...@@ -124,8 +124,7 @@ public class AssessmentPartTwo { ...@@ -124,8 +124,7 @@ public class AssessmentPartTwo {
if(UppercaseCheck || LowercaseCheck) { if(UppercaseCheck || LowercaseCheck) {
return false; return false;
} }
//try to push
//keeps getting rejected why
//creates a for loop that repeats for the number of characters in the array //creates a for loop that repeats for the number of characters in the array
char[] Letters = password.toCharArray(); char[] Letters = password.toCharArray();
...@@ -145,26 +144,25 @@ public class AssessmentPartTwo { ...@@ -145,26 +144,25 @@ public class AssessmentPartTwo {
return false; return false;
} }
//This Section creates the string passwd which contains "passwd"
String passwd = "passwd";
//This section converts password to lower case and says that if the string password is equal to passwd or contains passwd then it will return false
if ( password.toLowerCase().indexOf(passwd.toLowerCase()) != -1 ) {
//This section converts password to lower case and says that if the string password contains "passwd" it will return false
if ( password.toLowerCase().contains("passwd") ) {
return false; return false;
} }
//This Section creates the string passWord which contains "password"
String passWord = "password"; //This section converts password to lower case and says that if password contains "password" it will return false
//This section converts password to lower case and says that if the string password is equal to passWord or contains passWord then it will return false if ( password.toLowerCase().contains("password")) {
if ( password.toLowerCase().indexOf(passWord.toLowerCase()) != -1 ) {
return false; return false;
} }
//oof
} }
//If no of these conditions have been triggered the proram will return true //If no of these conditions have been triggered the proram will return true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment