Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package accountsetup;
- import java.util.Scanner;
- public class AccountSetup {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- String userName,password;
- System.out.print("Enter a username:");
- userName = input.nextLine();
- System.out.print("Enter a password that is at least eight characters:");
- password = input.nextLine();
- int len = password.length();
- do {
- System.out.print("Enter a password that is at least eight characters:");
- password = input.nextLine();
- len = password.length();
- } while (len <8);
- if (len >=8){
- System.out.print("Your username is "+userName+" and your password is "+password);
- }}}
Add Comment
Please, Sign In to add comment