Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Project{
- public static void main(String[] args){
- while(true){
- menu();
- }
- }
- public static void menu(){
- Scanner kb = new Scanner(System.in);
- System.out.println( "Please Enter the Password:");
- String x = kb.nextLine();
- if (x.equals ("lol") ){
- authentication();
- } else if (!x.equals ("lol")){
- failed();
- }
- }
- public static void authentication(){
- Scanner kb = new Scanner(System.in);
- System.out.println("Congratulations! You are now recognized. Please sign in with your username:");
- String UN = kb.nextLine();
- System.out.println("Congratulations " + UN + " you are now logged in!");
- System.out.println("Do you want to continue (yes or no)?");
- String x = kb.nextLine();
- if (x.equals ("yes")){
- welcome();
- } else if (x.equals ("no")){
- System.exit(0);
- }
- }
- public static void failed(){
- Scanner kb = new Scanner(System.in);
- System.out.println("Sorry, you failed to authenticate. Please try again. (This is your last chance)");
- String x = kb.nextLine();
- if (!x.equals ("lol")){
- infiniteloop();
- }
- else if (x.equals ("lol")){
- authentication();
- }
- }
- public static void infiniteloop(){
- for (int i=0;i<=10; i++){
- System.out.println("You have failed to authenticate!");
- }
- System.exit(0);
- }
- public static void welcome(){
- for (int i=0;i<=5000; i++) {
- System.out.println("0101010101010101001010101001010101001010110101010");
- System.out.println("1010101010101010110101010110101010110101001010101");
- }
- System.out.println("Welcome to the Matrix");
- System.exit(0);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement