desislava_topuzakova

04. Password Guess

Jan 15th, 2022
3,639
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.61 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class GuessPassword_04 {
  3.     public static void main(String[] args) {
  4.         Scanner scanner = new Scanner(System.in);
  5.         //1. парола (текст)
  6.         //2. проверка за паролата
  7.             //ако паролата е "s3cr3t!P@ssw0rd" -> "Welcome"
  8.             //ако пароалта не е -> "Wrong password!"
  9.         String password = scanner.nextLine();
  10.         if (password.equals("s3cr3t!P@ssw0rd")) {
  11.             System.out.println("Welcome");
  12.         } else {
  13.             System.out.println("Wrong password!");
  14.         }
  15.  
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment