Advertisement
veronikaaa86

05. Password Guess

May 15th, 2021
944
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.48 KB | None | 0 0
  1. package ConditionalStatements;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class P05PasswordGuess {
  6.     public static void main(String[] args) {
  7.         Scanner scanner = new Scanner(System.in);
  8.  
  9.         String input = scanner.nextLine();
  10.  
  11.         //s3cr3t!P@ssw0rd
  12.  
  13.         boolean isValid = input.equals("s3cr3t!P@ssw0rd");
  14.  
  15.         if (isValid) {
  16.             System.out.println("Welcome");
  17.         } else {
  18.             System.out.println("Wrong password!");
  19.         }
  20.     }
  21. }
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement