Advertisement
IanO-B

Untitled

Nov 26th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.  
  5. public static void main(String[] args) {
  6. Scanner keyboard = new Scanner (System.in);
  7. int pin = 12345;
  8. int maxtries = 0;
  9.  
  10. System.out.println("WELCOME TO THE BANK OF MITCHELL");
  11. System.out.println("ENTER YOUR PIN ");
  12. int entry = keyboard.nextInt();
  13. maxtries++;
  14.  
  15. while (entry != pin && maxtries < 4)
  16. {
  17. System.out.println("\n INCORRECT PIN. TRY AGAIN.");
  18. System.out.println("ENTER YOUR PIN");
  19. entry = keyboard.nextInt();
  20. maxtries++;
  21.  
  22. if (entry == pin)
  23. System.out.println("\n PIN ACCEPTED. YOU NOW HAVE ACCESS TO YOUR ACCOUNT. POGGERS");
  24. else if (entry >= 4)
  25. System.out.println("\n YOU HAVE RUN OUT OF TRIES. BIG BRUH.");
  26. }
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement