Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- else if (commandWord == CommandWord.REGISTER)
- {
- Scanner reader = new Scanner(System.in);
- String inputline;
- String username;
- String fullname;
- String password;
- clearScreen();
- System.out.println("------------------------");
- System.out.println("|**Welcome To Twitter**|");
- System.out.println("------------------------");
- System.out.println();
- System.out.println("Here you can register yourself as a new user");
- System.out.println("After registration, you will be taken to the homepage, where you can login");
- System.out.println("What will be your username?");
- System.out.println("Your username can only contain lettres and numbers, no spaces.");
- System.out.print("> ");
- username = reader.nextLine();
- boolean ok = twitterApp.checkAvailable(username);
- while(!ok)
- {
- System.out.println("This username appears to be taken, please try another one");
- System.out.print("> ");
- username = reader.nextLine();
- ok = twitterApp.checkAvailable(username);
- }
- System.out.println("What will be your password?");
- System.out.println("Your password can only contain lettres and numbers, no spaces.");
- System.out.print("> ");
- password = reader.nextLine();
- System.out.println("What is your full name?");
- System.out.print("> ");
- fullname = reader.nextLine();
- twitterApp.addUser(username, fullname, password);
- clearScreen();
- printWelcome();
Add Comment
Please, Sign In to add comment