Assignemnt #60 and Enter PIN

Code

/// Name: Tristan Chung
/// Period: 5
/// Program Name: Enter PIN
/// File Name: EnterPIN.java
/// Date Finished: 11/20/2015

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 TRISTAN.");
		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. Both if and while loops only read the proceeding code if their conditions are meant. 2. A while loop will repeat the code until the condition is met unlike the if statement that terminates the code. 3. entry is already set as a int variable. 4. The loop will not be able to ask you for another response and will continuously loop stating that your PIN is incorrect. 
	}
}
    

Picture of the output

Assignment 60