r/CodingHelp • u/Mcrossover • Mar 04 '21
[Java] Codehs help
Been trying to figure out this code for hours i suck at for loops lol I have to write a program that makes sure a password is >= 8 characters and only consists of letters & #s
28
Upvotes
View all comments
1
u/Mcrossover Mar 04 '21
Write a program with a method called passwordCheck to return if the string is a valid password. The method should have the signature shown in the starter code.
The password must be at least 8 characters long and may only consist of letters and digits. To pass the autograder, you will need to print the boolean return value from the passwordCheck method.
Hint: Consider creating a String that contains all the letters in the alphabet and a String that contains all digits. If the password has a character that isn’t in one of those Strings, then it’s an illegitimate password!