problema 1
//Practica 10 problema 1 Fecha: 4/11/2012
//Integrantes del equipo: Leonardo Rene Fraire Garcia
#include <iostream.h>
#include <conio.h>
int main ()
{
float numeros[10], suma=0.0, prom;
int i;
for (i=0; i<10; i++)
{
cout<<"Introduce valor flotante numeros["<<i<<"] : ";
cin>>numeros[i];
}
for (i=0; i<10; i++)
{
suma=suma+numeros[i];
}
prom=suma/10.0;
cout<<"\n";
cout<<"El promedio es = "<<prom<<endl;
cout<<"\n";
cout<<"Numeros>=promedio"<<endl;
cout<<"\n";
for (i=0; i<10; i++)
{
if (numeros[i]>=prom)
{
cout<<numeros[i]<<endl;
}}
getch ();
return 0;
}
//Integrantes del equipo: Leonardo Rene Fraire Garcia
#include <iostream.h>
#include <conio.h>
int main ()
{
float numeros[10], suma=0.0, prom;
int i;
for (i=0; i<10; i++)
{
cout<<"Introduce valor flotante numeros["<<i<<"] : ";
cin>>numeros[i];
}
for (i=0; i<10; i++)
{
suma=suma+numeros[i];
}
prom=suma/10.0;
cout<<"\n";
cout<<"El promedio es = "<<prom<<endl;
cout<<"\n";
cout<<"Numeros>=promedio"<<endl;
cout<<"\n";
for (i=0; i<10; i++)
{
if (numeros[i]>=prom)
{
cout<<numeros[i]<<endl;
}}
getch ();
return 0;
}
pseudocodigo
inicio
números [10],
suma=0.0, prom Real
i
int
for
(i=0, i<10, i++)
{
Print
"Introduce valor flotante números[",i,"] = "
Read números[i]
}
for
(i=0, i<10, i++)
{
suma=suma+numeros[i]
}
prom=suma/10
Print "El
promedio es = ", prom
Print
"Números >=promedio"
for
(i=0, i<10, i++)
{
if
(números[i]>=prom)
{
Print números
}}
fin
problema 2 a)
//Practica 10 problema 2 a) Fecha: 4/11/2012
//Integrantes del equipo: Leonardo Rene Fraire Garcia
#include <iostream.h>
#include <conio.h>
int main ()
{
float valores [10], desviacion [10];
float total=0.0, prom=0.0;
int i;
for (i=0; i<10; i=i+1)
{
cout<<"Valores ["<<i<<"] = ";
cin>>valores[i];
total=total+valores[i];
}
prom=total/10.0;
for (i=0; i<10; i=i+1)
{
desviacion[i]=valores[i]-prom;
}
cout<<"\n";
cout<<"Desviacion Valores"<<endl;
cout<<"\n";
for (i=0; i<10; i=i+1)
{
cout<<desviacion[i]<<"\t\t\t\t"<<valores[i]<<endl;
}
getch ();
return 0;
}
//Integrantes del equipo: Leonardo Rene Fraire Garcia
#include <iostream.h>
#include <conio.h>
int main ()
{
float valores [10], desviacion [10];
float total=0.0, prom=0.0;
int i;
for (i=0; i<10; i=i+1)
{
cout<<"Valores ["<<i<<"] = ";
cin>>valores[i];
total=total+valores[i];
}
prom=total/10.0;
for (i=0; i<10; i=i+1)
{
desviacion[i]=valores[i]-prom;
}
cout<<"\n";
cout<<"Desviacion Valores"<<endl;
cout<<"\n";
for (i=0; i<10; i=i+1)
{
cout<<desviacion[i]<<"\t\t\t\t"<<valores[i]<<endl;
}
getch ();
return 0;
}
pseudocodigo
inicio
valores [10], desviacion [10], total=0.0, prom=0.0 Real
i int
for (i=0, i<10, i=i+1)
{
Print "Valores [",i,"] = "
Read valores [i]
total=total+valores[i]
}
prom=total/10.0
for (i=0, i<10, i=i+1)
{
desviacion[i]=valores[i]-prom
}
Print "Desviacion Valores"
for (i=0, i<10, i=i+1)
{
Print desviacion[i], "\t\t\t\t", valores[i]
fin
i int
for (i=0, i<10, i=i+1)
{
Print "Valores [",i,"] = "
Read valores [i]
total=total+valores[i]
}
prom=total/10.0
for (i=0, i<10, i=i+1)
{
desviacion[i]=valores[i]-prom
}
Print "Desviacion Valores"
for (i=0, i<10, i=i+1)
{
Print desviacion[i], "\t\t\t\t", valores[i]
fin
probema 2 b)
//Practica 10 problema 2 b) Fecha: 4/11/2012
//Integrantes del equipo: Leonardo Rene Fraire Garcia
#include <iostream.h>
#include <conio.h>
#include <math.h>
int main ()
{
float valores [10], desviacion [10];
int i;
float total=0.0, prom=0.0, varianza=0.0;
for (i=0; i<10; i=i+1)
{
cout<<"Valores ["<<i<<"] = ";
cin>>valores[i];
total=total+valores[i];
}
prom=total/10.0;
for (i=1; i<10; i=i+1)
{
desviacion[i]=valores[i]-prom;
}
cout<<"\n";
for (i=0; i<10; i=i+1)
{
total=total+pow(desviacion[i],2);
}
varianza=total/10.0;
cout<<"La varianza es = "<<varianza<<endl;
getch ();
return 0;
}
//Integrantes del equipo: Leonardo Rene Fraire Garcia
#include <iostream.h>
#include <conio.h>
#include <math.h>
int main ()
{
float valores [10], desviacion [10];
int i;
float total=0.0, prom=0.0, varianza=0.0;
for (i=0; i<10; i=i+1)
{
cout<<"Valores ["<<i<<"] = ";
cin>>valores[i];
total=total+valores[i];
}
prom=total/10.0;
for (i=1; i<10; i=i+1)
{
desviacion[i]=valores[i]-prom;
}
cout<<"\n";
for (i=0; i<10; i=i+1)
{
total=total+pow(desviacion[i],2);
}
varianza=total/10.0;
cout<<"La varianza es = "<<varianza<<endl;
getch ();
return 0;
}
pseudocodigo
inicio
valores [10], desviacion [10], total=0.0, prom=0.0, varianza=0.0 Real
i Int
for (i=0, i<10, i=i+1)
{
Print "Valores [",i,"] = "
Read valores [i]
total=total+valores[i]
}
prom=total/10.0
for (i=1, i<10, i=i+1)
{
desviacion[i]=valores[i]-prom
}
for (i=0, i<10, i=i+1)
{
total=total+pow(desviacion[i],2)
}
varianza=total/10.0
Print "La varianza es = ", varianza
fin
i Int
for (i=0, i<10, i=i+1)
{
Print "Valores [",i,"] = "
Read valores [i]
total=total+valores[i]
}
prom=total/10.0
for (i=1, i<10, i=i+1)
{
desviacion[i]=valores[i]-prom
}
for (i=0, i<10, i=i+1)
{
total=total+pow(desviacion[i],2)
}
varianza=total/10.0
Print "La varianza es = ", varianza
fin
problema 3
//Practica 10 problema 3 Fecha: 4/11/2012
//Integrantes del equipo: Leonardo Rene Fraire Garcia
#include <iostream.h>
#include <conio.h>
int main ()
{
int x[14], max, min, intervalo, i;
for (i=0; i<14; i=i+1)
{
cout<<"x["<<i<<"] = ";
cin>>x[i];
}
max=x[0];
for (i=1; i<14; i=i+1)
{
if (x[i]>max)
{
max=x[i];
}
}
min=x[0];
for (i=0; i<14; i=i+1)
{
if (x[i]<min)
{
min=x[i];
}
}
intervalo=max-min;
cout<<"\n";
cout<<"Elementos de arreglo de X"<<endl;
cout<<"\n";
for (i=0; i<14; i=i+1)
{
cout<<x[i]<<"\t"<<endl;
}
cout<<"\n"<<"Maximo = "<<max<<endl;
cout<<"\n"<<"Minimo = "<<min<<endl;
cout<<"\n"<<"Intervalo = "<<intervalo<<endl;
getch ();
return 0;
}
//Integrantes del equipo: Leonardo Rene Fraire Garcia
#include <iostream.h>
#include <conio.h>
int main ()
{
int x[14], max, min, intervalo, i;
for (i=0; i<14; i=i+1)
{
cout<<"x["<<i<<"] = ";
cin>>x[i];
}
max=x[0];
for (i=1; i<14; i=i+1)
{
if (x[i]>max)
{
max=x[i];
}
}
min=x[0];
for (i=0; i<14; i=i+1)
{
if (x[i]<min)
{
min=x[i];
}
}
intervalo=max-min;
cout<<"\n";
cout<<"Elementos de arreglo de X"<<endl;
cout<<"\n";
for (i=0; i<14; i=i+1)
{
cout<<x[i]<<"\t"<<endl;
}
cout<<"\n"<<"Maximo = "<<max<<endl;
cout<<"\n"<<"Minimo = "<<min<<endl;
cout<<"\n"<<"Intervalo = "<<intervalo<<endl;
getch ();
return 0;
}
pseudocodigo
inicio
x[14], max, min, intervalo, i Int
for (i=0, i<14, i=i+1)
{
Print "x [",i,"] = "
Read x[i]
}
max=x[i]
for (i=1, i<14, i=i+1)
{
if (x[i]>max)
{
max=x[i]
}
}
min=x[0]
for (i=0, i<14, i=i+1)
{
if (x[i]<min)
{
min=x[i]
}
}
intervalo=max-min
Print "Elementos de arreglo de X"
for (i=0, i<14, i=i+1)
{
Print x[i],"\t",
}
Print "\n", "Maximo = ", max
Print "\n", "Minimo = ", min
Print "\n", "Intervalo = ", intervalo
fin
for (i=0, i<14, i=i+1)
{
Print "x [",i,"] = "
Read x[i]
}
max=x[i]
for (i=1, i<14, i=i+1)
{
if (x[i]>max)
{
max=x[i]
}
}
min=x[0]
for (i=0, i<14, i=i+1)
{
if (x[i]<min)
{
min=x[i]
}
}
intervalo=max-min
Print "Elementos de arreglo de X"
for (i=0, i<14, i=i+1)
{
Print x[i],"\t",
}
Print "\n", "Maximo = ", max
Print "\n", "Minimo = ", min
Print "\n", "Intervalo = ", intervalo
fin
problema 4
//Practica 10 problema 4 Fecha: 4/11/2012
//Integrantes del equipo: Leonardo Rene Fraire Garcia
#include <iostream.h>
#include <conio.h>
int main ()
{
int x[14], max, min, intervalo, i;
for (i=0; i<14; i=i+1)
{
cout<<"x["<<i<<"] = ";
cin>>x[i];
}
max=x[0];
for (i=1; i<14; i=i+1)
{
if (x[i]>max)
{
max=x[i];
}
}
min=x[0];
for (i=0; i<14; i=i+1)
{
if (x[i]<min)
{
min=x[i];
}
}
intervalo=max-min;
cout<<"\n";
cout<<"Elementos de arreglo de X"<<endl;
cout<<"\n";
for (i=0; i<14; i=i+1)
{
cout<<x[i]<<"\t"<<endl;
}
cout<<"\n"<<"Maximo = "<<max<<endl;
cout<<"\n"<<"Minimo = "<<min<<endl;
cout<<"\n"<<"Intervalo = "<<intervalo<<endl;
getch ();
return 0;
}
//Integrantes del equipo: Leonardo Rene Fraire Garcia
#include <iostream.h>
#include <conio.h>
int main ()
{
int x[14], max, min, intervalo, i;
for (i=0; i<14; i=i+1)
{
cout<<"x["<<i<<"] = ";
cin>>x[i];
}
max=x[0];
for (i=1; i<14; i=i+1)
{
if (x[i]>max)
{
max=x[i];
}
}
min=x[0];
for (i=0; i<14; i=i+1)
{
if (x[i]<min)
{
min=x[i];
}
}
intervalo=max-min;
cout<<"\n";
cout<<"Elementos de arreglo de X"<<endl;
cout<<"\n";
for (i=0; i<14; i=i+1)
{
cout<<x[i]<<"\t"<<endl;
}
cout<<"\n"<<"Maximo = "<<max<<endl;
cout<<"\n"<<"Minimo = "<<min<<endl;
cout<<"\n"<<"Intervalo = "<<intervalo<<endl;
getch ();
return 0;
}
pseudocodigo
inicio
x[14], max, min, intervalo, i Int
for (i=0, i<14, i=i+1)
{
Print "x [",i,"] = "
Read x[i]
}
max=x[i]
for (i=1, i<14, i=i+1)
{
if (x[i]>max)
{
max=x[i]
}
}
min=x[0]
for (i=0, i<14, i=i+1)
{
if (x[i]<min)
{
min=x[i]
}
}
intervalo=max-min
Print "Elementos de arreglo de X"
for (i=0, i<14, i=i+1)
{
Print x[i],"\t",
}
Print "\n", "Maximo = ", max
Print "\n", "Minimo = ", min
Print "\n", "Intervalo = ", intervalo
fin
x[14], max, min, intervalo, i Int
for (i=0, i<14, i=i+1)
{
Print "x [",i,"] = "
Read x[i]
}
max=x[i]
for (i=1, i<14, i=i+1)
{
if (x[i]>max)
{
max=x[i]
}
}
min=x[0]
for (i=0, i<14, i=i+1)
{
if (x[i]<min)
{
min=x[i]
}
}
intervalo=max-min
Print "Elementos de arreglo de X"
for (i=0, i<14, i=i+1)
{
Print x[i],"\t",
}
Print "\n", "Maximo = ", max
Print "\n", "Minimo = ", min
Print "\n", "Intervalo = ", intervalo
fin
No hay comentarios:
Publicar un comentario