Advertisement
Guest User

Untitled

a guest
Jan 24th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.67 KB | None | 0 0
  1. public class ATM {
  2.     public static void main(String[] args) {
  3.         int PIN = 3443;
  4.         Scanner odczytPinu = new Scanner(System.in);
  5.         System.out.println("Wprowadz PIN");
  6.         int wpisanyPIN = odczytPinu.nextInt();
  7.         for (int i = 1; wpisanyPIN != PIN; i++) {
  8.             if (i < 3) {
  9.                 System.out.println("Wpisano zły PIN. Wpisz numer PIN ponownie");
  10.                 wpisanyPIN = odczytPinu.nextInt();
  11.             } else {
  12.                 System.out.println("3 razy wpisano niepoprawny PIN. Karta zablokowana");
  13.                 return;
  14.             }
  15.         }
  16.         System.out.println("Ile hajsu chcesz wyplacic? ");
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement