Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Jimmy Alvarez
- // 10/16/18
- // CSC 111
- //In Class
- // Username and password
- // jtalvarez0001@student.stcc.edu
- import java.util.Scanner;
- public class InClassOct16 {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- System.out.println("This program will check your credentials");
- System.out.print("Please enter your username : ");
- String username = input.nextLine();
- System.out.print("Please enter your password : ");
- String password = input.nextLine();
- input.close();
- boolean access = false;
- if ((username.equalsIgnoreCase("csc-111")) && (password.equals("JavaIsFun"))) {
- access = true;
- }
- if (access) {
- System.out.println("Access Allowed");
- } else {
- System.out.println("Credentials Not Correct. Access Denied!!!");
- }
- }
- }
Add Comment
Please, Sign In to add comment