public class testingstring {
public static void main(String[] args)
{
Scanner userInput = new Scanner (System.in) ;
String specialChar = "!@#$%^&*()" ;
System.out.println("Enter your first name: ");
String firstName = userInput.next() ;
System.out.println("Enter your last name: ") ;
String lastName = userInput.next() ;
System.out.println("Enter your phone number: ") ;
String phoneNum = userInput.next() ;
}
}
The program should randomly generate 8 characters long password as follows:
- 3 random letters from the first name
- 2 random letters from the last name
- 2 random digits from the mobile phone number
- 1 random character from the variable 'specialChar'
Aucun commentaire:
Enregistrer un commentaire