borkins

09b. Password Guess

Mar 23rd, 2017
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.37 KB | None | 0 0
  1. /*
  2.  * Simple Conditions
  3.  */
  4. import java.util.Scanner;
  5.  
  6. public class _09b_PasswordGuess
  7. {
  8.     public static void main(String[] args)
  9.     {
  10.         Scanner scan = new Scanner(System.in);
  11.        
  12.         String userInput = scan.nextLine();
  13.         String pattern = "s3cr3t!P@ssw0rd";
  14.  
  15.         System.out.println(userInput.equals(pattern) ? "Welcome" : "Wrong password!");
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment