Advertisement
veronikaaa86

04. Password Guess

Sep 17th, 2022
1,579
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.42 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class P04PasswordGuess {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.         String password = "s3cr3t!P@ssw0rd";
  8.         String input = scanner.nextLine();
  9.  
  10.         if (input.equals(password)) {
  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
Advertisement