Ramirez Albarran Omar escom ipn 6SCV2

Site hosted by Angelfire.com: Build your free website today!

Practica 1

public class practica1
{
static int vocal,comas,puntos,posicion;

static int procesar (String cadena)
{
int num=0;
posicion=0;
for(int i=0 ; i<cadena.length() ; i++)
{
if(cadena.charAt(i)=='a' || cadena.charAt(i)=='e' || cadena.charAt(i)=='i' || cadena.charAt(i)=='o' || cadena.charAt(i)=='u')
{num++;vocal++;posicion=i;}

else if(cadena.charAt(i)==',')comas++;

else if(cadena.charAt(i)=='.')puntos++;

}
return num;
}

public static void main(String args[])
{

System.out.println("\n\nMayusculas |\tTamano |\t Vocales |\tPosicion\n");
for(int i=0 ; i < args.length ; i++)
System.out.println((i+1)+" "+args[i].toUpperCase()+ " \t\t" + args[i].length() + " \t\t" + procesar(args[i]) + " \t\t"+ posicion);

System.out.println("\nEspacios= "+(args.length-1)+" Comas= "+comas+" Puntos= "+puntos+" vocales= "+vocal);
}
}