Hello,
I am working on a password verifier that checks the characters to meet a certain criteria. The user enters in the number of passwords they need to check and then prompts them to enter each one. My for loop counter for each password is off. I am also having trouble with the word/# "null" and "0" appearing in the println when I run the program.
I need the user to be able to put in a password, then be prompted with a black space for the next password they need to enter. My code for the loop is as follows:
public void inputPassword () {
for (int i = 0; i < (passwordCount); i++) {
System.out.println(" Please enter each password: " + password);
password = keyboard.nextLine;
}
}
I know that the result of this is just adding the previous password onto the next line like "cat" then the next password will be "cat" + the next password entered and so on, im not sure how to correct this and get the loop to just take in a new password each time.
Then, like I said above when typing out a simple println like:
System.out.println( "Please enter your name:" + name);
the output is placing the word "null" right after the colon.
I apologize if this wasn't written in the correct format, but thank you for any assistance, my professor is very indirect with her "help".