Guest User

Untitled

a guest
Jul 30th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.77 KB | None | 0 0
  1. else if (commandWord == CommandWord.REGISTER)
  2.         {
  3.             Scanner reader = new Scanner(System.in);
  4.             String inputline;
  5.             String username;
  6.             String fullname;
  7.             String password;
  8.  
  9.             clearScreen();
  10.             System.out.println("------------------------");
  11.             System.out.println("|**Welcome To Twitter**|");
  12.             System.out.println("------------------------");
  13.             System.out.println();
  14.             System.out.println("Here you can register yourself as a new user");
  15.             System.out.println("After registration, you will be taken to the homepage, where you can login");
  16.  
  17.             System.out.println("What will be your username?");
  18.             System.out.println("Your username can only contain lettres and numbers, no spaces.");
  19.  
  20.             System.out.print("> ");
  21.             username = reader.nextLine();
  22.            
  23.             boolean ok = twitterApp.checkAvailable(username);
  24.  
  25.             while(!ok)
  26.             {
  27.                 System.out.println("This username appears to be taken, please try another one");
  28.                 System.out.print("> ");
  29.                 username = reader.nextLine();
  30.  
  31.                 ok = twitterApp.checkAvailable(username);
  32.             }
  33.  
  34.             System.out.println("What will be your password?");
  35.             System.out.println("Your password can only contain lettres and numbers, no spaces.");
  36.             System.out.print("> ");
  37.  
  38.             password = reader.nextLine();
  39.  
  40.             System.out.println("What is your full name?");
  41.             System.out.print("> ");
  42.  
  43.             fullname = reader.nextLine();
  44.  
  45.             twitterApp.addUser(username, fullname, password);
  46.  
  47.             clearScreen();
  48.  
  49.             printWelcome();
Add Comment
Please, Sign In to add comment