desislava_topuzakova

Untitled

Apr 10th, 2021
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class PasswordGuess_05 {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6. //1. парола -> текст от конзолата
  7. //2. проверка парола е "s3cr3t!P@ssw0rd" -> Welcome
  8. //3. противен случай -> "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