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.");
- System.out.println("please enter your pin: " );
- int entry = keyboard.nextInt();
- while(entry != PIN){
- System.out.println("Incorrect pin. Please try again");
- System.out.println("please enter your pin: ");
- entry = keyboard.nextInt();
- }
- System.out.println("Pin accepted. You now have access to your bank account.");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment