Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Abdul Khalil , 10/16/18 , Intro to Java, CSC-111, D01
- Inclass exercise #3
- */
- package inclass;
- import java.util.Scanner;
- public class Authentication {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- System.out.println("please enter your username");
- String username = input.nextLine();
- System.out.println("Please enter your password");
- String password = input.nextLine();
- if (username.equalsIgnoreCase("CSC-111")) {
- if (password.equals("JavaIsGood"))
- System.out.println("Access Allowed");
- else
- System.out.println("Credentials Not Correct. Access Denied!!!");
- } else
- System.out.println("Credentials Not Correct. Access Denied!!!");
- input.close();
- }
- }
Add Comment
Please, Sign In to add comment