Aquí esta el nº 8:
Código (java) [Seleccionar]
final int m=10;
final String alphabet = "0aeioudbcdrjk";
final char[] array= new char[m];
final int N = alphabet.length();
Random r = new Random();
for (int i = 0; i < m; i++) {
array[i]= alphabet.charAt(r.nextInt(N));
switch(array[i]){
case 'a': System.out.println("vocal: " + array[i]);break;
case 'e': System.out.println("vocal: " + array[i]);break;
case 'i': System.out.println("vocal: " + array[i]);break;
case 'o': System.out.println("vocal: " + array[i]);break;
case 'u': System.out.println("vocal: " + array[i]);break;
default:
System.out.println("consonante: " + array[i]);
}
}