desislava_topuzakova

03. Sum Numbers

Oct 9th, 2021
1,062
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.70 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class SumNumbers_07 {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         String username = scanner.nextLine();
  7.         String password = scanner.nextLine();
  8.  
  9.         //повтаряме: въвеждаме парола
  10.         // спирам: въведената парола == парола
  11.         //продължавам: въведената парола != парола
  12.  
  13.         String enteredPassword = scanner.nextLine();
  14.         while (!enteredPassword.equals(password)) {
  15.             enteredPassword = scanner.nextLine();
  16.         }
  17.         System.out.println("Welcome " + username + "!");
  18.  
  19.  
  20.  
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment