Use Java to write and run a simple console-window program for checking passwords. The program must satisfy the following requirements:
· When the program runs, it should first print its name, e.g., Password Checker
· The program should next prompt the user to enter a username, e.g.,
Please enter your username:
· The program should next prompt the user to enter a password, e.g.,
Please enter your password:
· If the user enters a correct password, i.e., one that matches an internal secret password, the program responds
You are approved by access control!, and quits.
· If the user enters an incorrect password, the program responds
Try again:
· If the user enters a correct password matching the secret one, the program responds
You are approved by access control!, and quits.
· If the user enters an incorrect password, the program responds
Sorry, and quits.
I kinda know where to begin but I have no idea with most of this assignment so any help would be awesome! thank you in advanced
this is all i have:
package class1;
import java.util.Scanner;
public class class1 {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("Password Checker");
System.out.println("Please enter your username");
Scanner keyboard = new Scanner(System.in);
int username = keyboard.nextInt () ;
}
}