Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package accountsetup;
- import java.util.Scanner;
- public class AccountSetup {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- String pass, user;
- int passIndex;
- Scanner input = new Scanner(System.in);
- System.out.print("Enter a user name: ");
- user = input.nextLine();
- do{
- System.out.print("\nEnter a password at least 8 characters: ");
- pass = input.nextLine();
- passIndex = pass.length();
- } while(passIndex < 8);
- user = user.toLowerCase();
- user = user.toUpperCase();
- System.out.print("\nYour user name is: " + user + " and your password is: " + pass +"\n");
- }
- }
Add Comment
Please, Sign In to add comment