Tuesday, November 13, 2012

Practica 11



Problema 1a
Inicio
voltios [9] real
I int
for(I =0 to 9 step I++)
{
Print "voltios["<<I<<"]="
Read voltios[I]
}
Print lista de valores de voltios"
for(I=0 to 9 step I++)
{
Print voltios [I] ”  
}
Fin

Problema 1b
Inicio
voltios [9] real
I int
for(I =0 to 9 step I++)
{
Print "voltios["<<I<<"]="
Read voltios[I]
}
Print lista de valores de voltios"
for(I=0 to 9 step I++)
{
Print voltios [I] ”  
If (I%==0)
}
Fin


Problema 2
Inicio
temp[8], total=0,I int
for(I=0 to 8 step I++)
   {
Print "temp[ "<<I<<"]= "
Read temp[I]
total=total+temp[I]
   }
Print “listado de temperaturas"
   for(I=0 to 8 steop I++)
   {
Print temp[I],  "  "
   }
Print " promedio  ", (total/8)
Fin
 


Problema 3a
Inicio
fmax[9],mayor=0 real
I int
for(i=0 to 10 step i++)
{
Print "fmax["<<i<<"]="
Read fmax[i]
if(fmax[i]>mayor)
mayor=fmax[i]
}
for(i=0 to 10 step i++)
{
Print fmax[i], “ “
}
Print "el numero mayor es= , mayor
Fin

Problema 3b
Inicio
fmax[9],mayor=0,pos real
I int
for(i=0 to 10 step i++)
{
Print "fmax["<<i<<"]="
Read fmax[i]
if(fmax[i]>mayor)
{
mayor=fmax[i]
pos=i+1
}
}
for(i=0 to 10 step i++)
{
Print fmax[i], “ “
}
Print "el numero mayor es= , mayor
Print “Este es el elemento numero ", pos, " en la lista de numeros"
Fin


Problema 3c
Inicio
fmax[9],mayor=0,pos. menor=0, posm=0 real
I int
for(i=0 to 10 step i++)
{
Print "fmax["<<i<<"]="
Read fmax[i]
if(fmax[i]>mayor)
{
mayor=fmax[i]
pos=i+1;
}
if (fmax[i]<menor or menor==0)
{
menor=fmax[i]
posm=i+1
}
}
for(i=0 to 10 step i++)
{
Print fmax[i], “ “
}
Print "el numero mayor es= , mayor
Print “Este es el elemento numero ", pos, " en la lista de numeros"
Print "el número menor es= , menor
Print “Este es el elemento numero ", posm, " en la lista de numeros"
Fin


Problema 4a
Inicio
calif [14], I, suma=0 int
promedio, desviacion [14] real
for (I=0 to 14 step I++)
{
Print "calificacion" , (I+1), "="
Read calif[I]
suma=suma+calif[I]
}
promedio=suma/14.0
for (I=0 to 14 step I++)
{
desviacion [I]=calif [I]-promedio
}
Print "valor\t\tdesviacion"
for (I=0 to 14 step I++)
{
Print calif [I], "  ", desviacion [I]
}
Fin

Problema 4b
Inicio
calif [14], I, suma=0 int
promedio, desviacion [14] real
for (I=0 to 14 step I++)
{
Print "calificacion" , (I+1), "="
Read calif[I]
suma=suma+calif[I]
}
promedio=suma/14.0
for (I=0 to 14 step I++)
{
desviacion [I]=calif [I]-promedio
}
Print "valor\t\tdesviacion"
for (I=0 to 14 step I++)
{
Print calif [I], "  ", desviacion [I]
}
suma=0
for (I=0 to 14 step I++)
{
suma=suma+pow(desviacion [I],2)
}
varianza=suma/14.0
Print "la varianza es=", varianza
Fin


 





Tuesday, November 6, 2012

Practica 10



Problema 9 pagina 274
Inicio
AL, a=11.7e-6 real
L=7365, to=0, tf int
Print "Temperatura final (celcius) Longitud Expandida"
for(tf=5 to tf<=40 step tf=tf+5)
{
AL=a*L*(tf-to);
Print tf, AL
Fin






Problema10  Pagina274
Inicio
a=2, t int
prob real
Print "Tiempo \t Probabilidad de la llamada"
for(t=1 to t<=10 step t=t+1)
{
prob=1-exp(-t/a)
Print t, "  ", prob
}
Fin




 
Problema 12 página 275
Inicin
 g=32 int
d=0.0,t,interval real
Print "Tiempo  Distancia en el intervalo   Distancia total"
Fo r(t=0 to t<=10 step t=t+1)
{
intervalo=(1.0/2.0)*g*pow(t,2)
d=d+intervalo
Print " ", t, "   ", interval, “   ", d
}
Fin



Problema 1a Pagina 292
Inicio
Calif int
do
{
Print "calificacion = "
Read calif
if(calif>=0 && calif<=100)
   {
   Print calif
   }
   }
while (calif>=0 && calif<=100);
Fin



Problema 1b Pagina 292
Inicio
Calf int
do
{
Print "calificacion="
Read calf
if (calf>=0&&calf<=100)
{
Print calf
}
else
{
Print "calificacion invalida"
}
}
while (calf>=0&&calf<=100)
Fin 



 Problema 1c Página 292
Inicio
Calif int
do
{
Print "calificacion = "
Read calif
if(calif>=0 && calif<=100)
   {
Print calif
   }
   else
{
Print “calificacion invalida”
   }
   while (calif!=999);
Fin



 Problema 1d Página 292
Inicio
calf, n=0 int
do
{
Print "calificacion="
Read calf
if (calf>=0&&calf<=100)
{
Print calf
}
else
{
Print "calificacion invalida"
n=n+1
}
}
while (n!=5)
Fin



Problema 2 Pagina 292
Inicio
Calf int
suma=0.0, n, promedio real
do
{
Print "calificacion=”
Read calf
if (calf>=0&&calf<=100)
{
Print calf
suma=suma+calf
n=n+1
}
else
{
Print "calificacion invalida"
}
}
while (calf!=999)
promedio=suma/n
Print "el promedio es=", promedio
Fin



 Problema 3 Pagina 292
Inicio
Variable int
Print "Introduze un numero "
 Read variable
 do
 {
Print (variable%10)
 variable=variable/10
 }
 while(variable!=0)
Fin