Assignment #60 and EnterPIN
Code
///John Mulligan
///period 5
///Program Name: EnterPIN
///File Name: EnterPIN.java
import java.util.Scanner;
public class EnterPIN
{
public static void main( String[] args )
{
Scanner pinbot = new Scanner(System.in);
int pin = 12345;
System.out.println("Welcome to the Bank of Dank.");
System.out.println("Enter your pin: ");
int entry = pinbot.nextInt();
while ( entry != pin )
{
System.out.println("\nIncorrect pin. Try again.");
System.out.println("Enter your pin: ");
entry = pinbot.nextInt();
}
System.out.println("\nPin accepted. You now have access to your account.");
}
}