SHARE
TWEET

Untitled

a guest Jan 19th, 2020 89 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.             case 4:     // Requests current PIN, then asks for and sets new PIN
  2.                 System.out.print("**********************************************"
  3.                         + "\nEnter current PIN: ");
  4.                 while (true) {
  5.                     input = new Scanner(System.in);
  6.                     String inputtedPin = input.next();
  7.  
  8.                     // Ensures PIN is 4 number characters
  9.                     if (!inputtedPin.equals(accounts.get(inputtedId).getPin())) {
  10.                         System.out.print("Invalid PIN. Please try again: ");
  11.                         continue;
  12.                     } else {
  13.                         // Sets new PIN
  14.                         System.out.print("\nEnter new 4-digit PIN: ");
  15.                         inputtedPin = input.next();
  16.  
  17.                         // Ensures PIN is 4 number characters
  18.                         while (!inputtedPin.matches("[0-9]{4}")) {
  19.                             System.out.print("New PIN must be 4 digits. Please try again: ");
  20.                             inputtedPin = input.next();
  21.                         }
  22.                     }
  23.  
  24.                     // Sets account PIN to the new one
  25.                     accounts.get(inputtedId).setPin
  26.                             (inputtedPin);
  27.                     System.out.println("PIN successfully changed!");
  28.                     mainMenu(accounts, inputtedId);
  29.                     break;
  30.                 }
  31.                 break;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top