Assignment #64 PIN LOCKOUT

Code

    /// Name: DeeJay Cerezo
/// Period: 7
/// Program Name: PIN Lockout
/// File Name: Lockout.java
/// Date Finished: 12/9/2015


import java.util.Scanner;

public class Lockout
{
	public static void main( String[] args )
	{
		Scanner keyboard = new Scanner(System.in);
		int pin = 12345;
		int tries = 0;
        int tries2 = 4;
        

		System.out.println("WELCOME TO THE BANK OF JOSHUA.");
		System.out.print("ENTER YOUR PIN: ");
		int entry = keyboard.nextInt();
		tries++;

		while ( entry != pin && tries < tries2 )
		{
			System.out.println("\nINCORRECT PIN. TRY AGAIN.");
			System.out.print("ENTER YOUR PIN: ");
			entry = keyboard.nextInt();
			tries++;
		}

		if ( entry == pin )
			System.out.println("\nPIN ACCEPTED. YOU NOW HAVE ACCESS TO YOUR ACCOUNT.");
		else if ( tries >= tries2 )
			System.out.println("\nACCOUNT LOCKED. SEE ADMINISTRATOR FOR ASSISTANCE.");
	}
}

    

Picture of the output

Assignment 64