miércoles, 14 de marzo de 2012

Practica 9 Unidad 2

Problema 1
Programa para modelo de calcular la población 
Inicio 
a= 0, t= 0 Int
poblacion= 0.0 Real 
Print "Anio    Poblacion con miles de personas"
for ( a=1985 to 2012 step a= a + 1 )
{  poblacion= 4.88 * ( 1 * exp ( 0.02 * t ) )
    Print a, "/t", poblacion
    t= t +1
}
Fin 

Problema 2
Programa para calcular el voltaje de 5 generadores 
a)
Inicio
g= 0, t=0 Int
resultado= 0.0, suma= 0.0 Real
for ( g= 1 to 5 step g= g +1 )
{   Suma= 0.0
     Print "/n Introduce los resultados de prueba de generador", g
 for ( t= 1 to 3 step t= t +1 )
{    Print "Resultado", t, "="
      Read resultado
      suma = suma + resultado
}
Print "Promedio = ", ( suma / 9.0 )
}
Fin

b)
Inicio
g= 0, t= 0 Int
resultado= 0.0, suma= 0.0, promt= 0.0 Real
for ( g= 1 to 5 step g= g + 1 )
{   suma= 0.0
     Print "/n Introduce los resultados de prueba de generador", g
for ( t= 1 to 3 step t = t = 1 )
{   Print "Resultado", t , "="
     Read resultado
     suma = suma + resultado
}
promt= promt + ( suma / 3.0 )
Print "Promedio generador ", g , "=", ( suma / 3.0 )
}
Print " Promedio de los 5 generadores es: ", ( promt / 5.0 )
Fin

c)
Inicio
g = 0 Int
r1, r2, r3, suma = 0.0 Real
for ( g = 1 to 5 step g = g + 1 )
{  
Print "/n Voltaje de prueba 1= "
Read r1
Print " Voltaje de prueba 2= "
Read r2
Print " Voltaje de prueba 3= "
Read r3
Suma = ( r1 + r2 + r3 )
Print " Promedio generador no. ", g , "=", ( suma / 3.0 )
}
Fin

Problema 3
Programa para calcular y = xz / ( x - z )
Inicio
x= 0, z= 0, y= 0 Int
Print " x  /t  z  /t  y "
for ( z= 1 to 5 step x = x + 1 )
{
for ( z= 2 to 6 step z = z + 1 )
{
Print x, "/t", z, "/t"
if ( x == z )
{
Print " Funcion indefinida"
}
else
{
y = x * z / ( x - z )
Print y
}}}
Fin
Problema 4
Programa para calcular valores de x y y. 
a)
Inicio
x = 0.0, y = 0.0 Real
Print " x   /t   y"
for ( x = 1 to 5 step x = x + 0.5 )
{
y = x + pow ( x , 2.0) / 2.0 + pow ( x , 3.0 ) / 6.0 + pow ( x , 4.0 ) / 24.0
Print x, "/t", y
}
Fin

b)
Inicio
x = 0.0, y = 0.0, t = 0.0 Real
Print " t   /t   y "
for ( t = 1 to 3 step t = t + 0.1 )
{
y = 2 * exp ( 0.08 * t )
Print t , " /t ", y
}
Fin
c)
Inicio 
x = 0.0, y = 0.0 Real 
Print " x   /t   y "
for ( x = 4 to 10 step x = x + 0.2 )
{
y = 3 * pow ( x , 5 ) - 2 * pow ( x , 3 )+4 * pow ( x , 2) - x
Print x, "/t", y
}
Fin 




No hay comentarios:

Publicar un comentario