lol1234561

Untitled

Mar 1st, 2023
706
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.62 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class Main {
  3.     public static void main(String[] args) {
  4.         Scanner keyboard = new Scanner(System.in);
  5.         int PIN = 12345;
  6.         System.out.println("Welcome to the bank.");
  7.         System.out.println("please enter your pin: " );
  8.         int entry = keyboard.nextInt();
  9.         while(entry != PIN){
  10.             System.out.println("Incorrect pin. Please try again");
  11.             System.out.println("please enter your pin: ");
  12.             entry = keyboard.nextInt();
  13.  
  14.         }
  15.         System.out.println("Pin accepted. You now have access to your bank account.");
  16.  
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment