Sunteți pe pagina 1din 3

/*

* To change this license header, choose License Headers in Project Properties.


* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package clase.pkg4.facundo;

/**
*
* @author EducaciónIT
*/
public class Clase4Facundo {

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here

byte limI=4, limJ=4;


for (byte i=0; i<=limI;i++)
{
for (byte j=0; j<=limJ; j++)
{
System.out.print(" @ ");
}
System.out.println();
limJ--;
}

System.out.println();
System.out.println();
System.out.println("__________________________________________");

byte limI2=8, limJ2=0;


for (byte i2=0; i2<=limI2;i2++)
{
for (byte j2=0; j2<=4; j2++)
{
System.out.print(" @ ");
}
System.out.println();
if (limI2<=4)
limJ2++;
else
limJ2--;

System.out.println();
System.out.println();
System.out.println("__________________________________________");

String [] nombres= new String [15];


nombres[14]= "Josè";
float [] temperaturas;
temperaturas= new float [10];
temperaturas[0]=25.80f;
temperaturas[4]=19.02f;

System.out.println(temperaturas[4]);
System.out.println(nombres[14]);

int [] nums= {27, -1001,587,36,-951,12,1702,123123,342234234,213123123};


int kl; kl=nums.length;

for(byte i=0; i<kl; i++)


System.out.println(nums[i]);

/* int [] intnuevos= new int [15];


intnuevos[3]=213213213;

for(byte i=0; i<15; i++)


System.out.println(intnuevos[i]);
}
*/

/* char [] origen= {'2','s','d','s','s','@'};


char [] destino= new char [origen.length];
destino=origen;

for(byte i=0; i<origen.length; i++)


System.out.println(destino[i]);

System.out.println(destino[2]);
destino[3]='7';
System.out.println(origen[3]);
MALLLLLLLLLL*/

char [] origen= {'2','s','d','s','s','@'};


char [] destino= new char [origen.length];

for(byte i=0; i<origen.length; i++ )


{
destino[i]=origen[i];
System.out.println(destino[i]);
}

System.out.println("__________________");
for(byte i=0; i<origen.length; i++)
System.out.println(origen[i]);

destino[3]='Ç';
System.out.println("__________________");
for(byte i=0; i<destino.length; i++)
System.out.println(destino[i]);

System.out.println(origen[3]);
System.out.println("___________________");
byte[] vec= {10,20,5,15,30,20};

for(byte i=0, b=0; i<vec.length;i++)


System.out.println("Ìndice "+i+" de vec con valor de "+vec[i]);

System.out.println("__________________________________");

short total=0;
float promedio;
for(byte i=0; i<vec.length;i++)
{
total+=vec[i];
}

System.out.println("El total es: "+total);

System.out.println("El promedio es "+(total/vec.length));


System.out.println("__________________________________");

for(byte j=0; j<vec.length;j++)


if ((j%2)!=0)
System.out.println("El ìndice impar "+j+" tiene un valor de
"+vec[j]);

byte mayor= vec[0];

for (byte j=0; j<vec.length;j++)


if (mayor<vec[j])
{
mayor=vec[j];
}

System.out.println("el valor mayor es :"+mayor);

for (byte j=0; j<vec.length;j++)


if (vec[j] == 20)
{
System.out.println("El ìndice nùmero "+j+" es igual a 20");

}
}

S-ar putea să vă placă și