Assignment #60 and Enter Your PIN
Code
/// Name: Tim Chuang
/// Period: 7
/// Program Name: Enter Your PIN
/// File Name: EnterYourPIN.java
/// Date Finished: 12/4/2015
import java.util.Scanner;
public class EnterYourPIN
{
// They're similar because they both have requirements//
// While loops repeat the unlike if statements//
// It has been established that entry is an int//
// It repeats cus you can't re-enter the pin//
public static void main ( String[] args )
{
Scanner keyboard = new Scanner(System.in);
int pin = 12345;
System.out.println("Welcome to the dank bank");
System.out.print("Whats ur pin: ");
int entry = keyboard.nextInt();
while ( entry != pin )
{
System.out.println("Wwao no gtfo");
System.out.print("Whats ur pin: ");
entry = keyboard.nextInt();
}
System.out.println("\nPIN accepted. Heres ur account");
}
}
Picture of the output