Assignment #60


    /// Name: Mahima Choudhary
    /// Period: 6
    /// Program Name: Enter Your PIN
    /// File Name:
    /// Date Finished: 12/3/2015
    import java.util.Scanner;

    public class EnterPIN
        public static void main(String[] args)
            Scanner keyboard = new Scanner(;
            int pin = 12345;
            System.out.println("WELCOME TO THE BANK OF MAHIMA.");
            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.");
    //while loops is a similar if statements beacause both run only when conditions are met, 
    //while loops are different from if statements in that they continue to run until conditions are not met
    //there isnt an int because there was one outside of the while group
    //the while loop continues to run forever when it is removed

Picture of the output

Assignment 60