Guest User

Untitled

a guest
Oct 16th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. // Jimmy Alvarez
  2. // 10/16/18
  3. // CSC 111
  4. //In Class
  5. // Username and password
  6. // jtalvarez0001@student.stcc.edu
  7.  
  8. import java.util.Scanner;
  9.  
  10. public class InClassOct16 {
  11.  
  12. public static void main(String[] args) {
  13.  
  14. Scanner input = new Scanner(System.in);
  15.  
  16. System.out.println("This program will check your credentials");
  17.  
  18. System.out.print("Please enter your username : ");
  19. String username = input.nextLine();
  20. System.out.print("Please enter your password : ");
  21. String password = input.nextLine();
  22. input.close();
  23.  
  24. boolean access = false;
  25. if ((username.equalsIgnoreCase("csc-111")) && (password.equals("JavaIsFun"))) {
  26. access = true;
  27. }
  28.  
  29. if (access) {
  30. System.out.println("Access Allowed");
  31. } else {
  32. System.out.println("Credentials Not Correct. Access Denied!!!");
  33. }
  34.  
  35. }
  36.  
  37. }
Add Comment
Please, Sign In to add comment