Assignment #60 and Enter Your Pin

Code

    ///Name: Tim Gibson
    ///Period: 6
    ///Project Name: Enter Your Pin
    ///File Name: EnterPin.java
    ///Date Finished: 10/19/15
        
    import java.util.Scanner;
    
    public class EnterPin
    {
    	public static void main( String[] args )
    	{
    		Scanner keyboard = new Scanner(System.in);
    		int pin = 12345;
    
    		System.out.println("WELCOME TO THE BANK OF Tim.");
    		System.out.print("ENTER YOUR PIN: ");
    		int entry = keyboard.nextInt();
    
    		while ( entry != pin )
    		{
    			System.out.println("\nINCORRECT PIN. TRY AGAIN.");
    			System.out.print("ENTER YOUR PIN: ");
    			entry = keyboard.nextInt();
    		}
    
    		System.out.println("\nPIN ACCEPTED. YOU NOW HAVE ACCESS TO YOUR ACCOUNT.");
            
    
    	}
    }
            //1.A while loop is similar to an if statement in how it will do the functions contained in it when a certain condition is met.
            //2.A while statement is different becaus it will repeat itself as long as the condition is still met.
            //3. because entry has already been declared as an integer.
            //4.The program just keeps displaying incorrect pin, try again, because the condition is still met, and it wont hcnage since there's no chance to change the entry
        

Picture of the output

Assignment60