Monty374

accountSetup

Oct 5th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. package accountsetup;
  2.  
  3. import java.util.Scanner;
  4. public class AccountSetup {
  5.  
  6. /**
  7. * @param args the command line arguments
  8. */
  9. public static void main(String[] args) {
  10. String pass, user;
  11. int passIndex;
  12. Scanner input = new Scanner(System.in);
  13.  
  14. System.out.print("Enter a user name: ");
  15. user = input.nextLine();
  16. do{
  17. System.out.print("\nEnter a password at least 8 characters: ");
  18. pass = input.nextLine();
  19. passIndex = pass.length();
  20. } while(passIndex < 8);
  21. user = user.toLowerCase();
  22. user = user.toUpperCase();
  23. System.out.print("\nYour user name is: " + user + " and your password is: " + pass +"\n");
  24.  
  25. }
  26.  
  27. }
Add Comment
Please, Sign In to add comment