Advertisement
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;
- int maxtries = 0;
- System.out.println("WELCOME TO THE BANK OF MITCHELL");
- System.out.println("ENTER YOUR PIN ");
- int entry = keyboard.nextInt();
- maxtries++;
- while (entry != pin && maxtries < 4)
- {
- System.out.println("\n INCORRECT PIN. TRY AGAIN.");
- System.out.println("ENTER YOUR PIN");
- entry = keyboard.nextInt();
- maxtries++;
- if (entry == pin)
- System.out.println("\n PIN ACCEPTED. YOU NOW HAVE ACCESS TO YOUR ACCOUNT. POGGERS");
- else if (entry >= 4)
- System.out.println("\n YOU HAVE RUN OUT OF TRIES. BIG BRUH.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement