Advertisement
veronikaaa86

02. Password

Apr 1st, 2023
3,916
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.46 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 username = scanner.nextLine();
  10.         String regPass = scanner.nextLine();
  11.  
  12.         String pass = scanner.nextLine();
  13.         while (!pass.equals(regPass)) {
  14.             pass = scanner.nextLine();
  15.  
  16.         }
  17.         System.out.printf("Welcome %s!", username);
  18.  
  19.     }
  20. }
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement