Advertisement
veronikaaa86

02. Password

Jul 31st, 2021
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. package whileLoop;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class P02Password {
  6. public static void main(String[] args) {
  7. Scanner scanner = new Scanner(System.in);
  8.  
  9. String regUser = scanner.nextLine();
  10. String regPass = scanner.nextLine();
  11.  
  12. String input = scanner.nextLine();
  13.  
  14. while (!input.equals(regPass)) {
  15.  
  16. input = scanner.nextLine();
  17. }
  18.  
  19. System.out.printf("Welcome %s!",regUser);
  20. }
  21. }
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement