Assignemnt #60 and PIN
Code
/// name: Leila Ordukhani
/// period: 6
/// program name: Fiftieth Program
/// file name: PIN.java
/// date finished: 12/1/15
import java.util.Scanner;
public class PIN
{
public static void main( String[] args )
{
Scanner keyboard = new Scanner(System.in);
int pin = 12345;
System.out.println("WELCOME TO THE LEILA ORDUKHANI BANK.");
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.");
}
}
Picture of the output