Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner keyboard = new Scanner (System.in);
- int pin = 12345;
- System.out.println("Welcome to the bank of Doyle");
- System.out.println("Please enter your PIN: ");
- int entry = keyboard.nextInt();
- while (entry != pin){
- System.out.println("\nIncorrect PIN. Please try again.");
- System.out.println("Please enter your PIN: ");
- entry = keyboard.nextInt() ;
- }
- System.out.println("\nPIN accepted. You now have access to your account");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment