Problema 1a
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
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
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
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
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++)
{
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), "="
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


No comments:
Post a Comment