[SOLVED] Need help with Loops...please!
Hey thanks for your time. Can you please help me with my program. Originally this code asks the user to input a password until he/she gets it correct. But I am suppose to change the code to make it where the user gets only 3 tries to get it correct. Can somebody please help me and tell me what I am suppose to do. Thanks!
import java.util.Scanner;
class Example3 {
public static void main (String[] args)
{
Scanner scan = new Scanner(System.in);
String password = "";
while(!(password.equals("branes")))
{
System.out.println("What is the password");
password = scan.nextLine();
}
System.out.println("Welcome!");
}
}