Guest User

Untitled

a guest
Oct 16th, 2018
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. /*
  2. Abdul Khalil , 10/16/18 , Intro to Java, CSC-111, D01
  3. Inclass exercise #3
  4. */
  5.  
  6. package inclass;
  7.  
  8. import java.util.Scanner;
  9.  
  10. public class Authentication {
  11.  
  12. public static void main(String[] args) {
  13.  
  14. Scanner input = new Scanner(System.in);
  15.  
  16. System.out.println("please enter your username");
  17. String username = input.nextLine();
  18. System.out.println("Please enter your password");
  19. String password = input.nextLine();
  20.  
  21. if (username.equalsIgnoreCase("CSC-111")) {
  22. if (password.equals("JavaIsGood"))
  23. System.out.println("Access Allowed");
  24.  
  25. else
  26. System.out.println("Credentials Not Correct. Access Denied!!!");
  27. } else
  28. System.out.println("Credentials Not Correct. Access Denied!!!");
  29.  
  30. input.close();
  31. }
  32.  
  33. }
Add Comment
Please, Sign In to add comment