Advertisement
tchenkov

L03u09_PasswordGuess

Jan 18th, 2017
546
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.49 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. /*
  4.  * Created by todor on 18.01.2017 г..
  5.  */
  6. public class u09_PasswordGuess {
  7.     public static void main(String[] args) {
  8.  
  9.         Scanner scan = new Scanner(System.in);
  10.  
  11.         String myPassword = "s3cr3t!P@ssw0rd";
  12.         String userPassword = scan.nextLine();
  13.  
  14.         if (myPassword.equals(userPassword)){
  15.             System.out.println("Welcome");
  16.         }
  17.         else {
  18.             System.out.println("Wrong password!");
  19.         }
  20.  
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement