Well, according to your code, everything what you've entered will be passed.
At first, this is wrong.
while (validUser != true)
In your code, there is no statement to set validUser = true so it always break out when you input password and userid at once.
Second, there is no matching statement and reflect matching result to failedLogin variable.
You only read password and encrypt it, but there is no matching statement so it's reflection result failedLogin is no longer usable.
It's my opinion.