Advertisement
Guest User

Untitled

a guest
Mar 19th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.73 KB | None | 0 0
  1. /*
  2.  * Andy Huynh
  3.  * CS170
  4.  * March 19, 2018
  5.  *
  6.  * Exercise 15
  7.  */
  8.  
  9. import java.util.Scanner;
  10.  
  11. public class passwords
  12. {
  13.     public static void main(String[] args)
  14.     {
  15.         Scanner input = new Scanner(System.in);
  16.         String[] usernames = {"Dog","Cat","Snake","Bird","Fox"};
  17.         String[] passwords = {"Woof","Meow","Hiss","Chirp","What"};
  18.        
  19.         System.out.println("Enter username: ");
  20.         int user = input.nextInt();
  21.         System.out.println("Enter password: ");
  22.         int pass = input.nextInt();
  23.        
  24.         if (user == ("Dog") && pass == ("Woof"))
  25.             System.out.println("Access Granted!");
  26.         else
  27.             System.out.println("Access Denied!");
  28.        
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement