0
Help me find a way to add the code to a loop so that the user is given 3 chances to enter the username and password correctly.
3 odpowiedzi
+ 2
maybe use some counter like:
int counter = 0;
if(loginFailed)
counter++;
and then write like
if(loginSuccess && counter < 3)
+ 2
You could store the amount of attempts in a variable, then check the variable after each try. If variable == 3, then end.
Sorry I'm typing this at work, so can't check your code.
0
thank you so much for the answers. i'm gonna try it.