Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.65 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Project{
  4.    
  5.     public static void main(String[] args){
  6.         while(true){
  7.             menu();
  8.         }
  9.     }  
  10.     public static void menu(){
  11.         Scanner kb = new Scanner(System.in);
  12.  
  13.  
  14.         System.out.println( "Please Enter the Password:");
  15.  
  16.         String x = kb.nextLine();
  17.  
  18.         if (x.equals ("lol") ){
  19.             authentication();
  20.         } else if (!x.equals ("lol")){
  21.             failed();
  22.         }
  23.                
  24.     }
  25.     public static void authentication(){
  26.         Scanner kb = new Scanner(System.in);
  27.        
  28.         System.out.println("Congratulations! You are now recognized. Please sign in with your username:");
  29.        
  30.         String UN = kb.nextLine();
  31.  
  32.         System.out.println("Congratulations " + UN + " you are now logged in!");
  33.  
  34.         System.out.println("Do you want to continue (yes or no)?");
  35.         String x = kb.nextLine();
  36.         if (x.equals ("yes")){
  37.             welcome();
  38.         } else if (x.equals ("no")){
  39.  
  40.             System.exit(0);
  41.  
  42.         }
  43.     }
  44.     public static void failed(){
  45.         Scanner kb = new Scanner(System.in);
  46.  
  47.         System.out.println("Sorry, you failed to authenticate. Please try again. (This is your last chance)");
  48.         String x = kb.nextLine();
  49.         if (!x.equals ("lol")){
  50.             infiniteloop();
  51.         }
  52.         else if (x.equals ("lol")){
  53.             authentication();
  54.         }
  55.  
  56.     }
  57.        
  58.        
  59.     public static void infiniteloop(){
  60.         for (int i=0;i<=10; i++){
  61.             System.out.println("You have failed to authenticate!");
  62.         }
  63.         System.exit(0);
  64.     }
  65.     public static void welcome(){
  66.         for (int i=0;i<=5000; i++) {
  67.             System.out.println("0101010101010101001010101001010101001010110101010");
  68.             System.out.println("1010101010101010110101010110101010110101001010101");
  69.         }
  70.         System.out.println("Welcome to the Matrix");
  71.         System.exit(0);
  72.     }
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement