domingo, 11 de octubre de 2009

6.3 Poblacion

PSEUDOCODIGO
Inicio
double t = 0.0;
double p;

for (t = 1994; t <=2010; t = t + 1)
{
p=4.8*(1+ Math.Exp(0.02*t));
Print("t y p");
}
Fin




CODIGO EN CONSOLA


static void Main(string[] args)
{
double t = 0.0;
double p;

for (t = 1994; t <=2010; t = t + 1)
{
p=4.8*(1+ Math.Exp(0.02*t));
Console.WriteLine("En el año " + t + " la poblacion era igual a = " + p);
}

Console.ReadLine();
}


CONSOLA EN WINDOWS



double t = 0.0;
double p;

for (t = 1994; t <= 2010; t = t + 1)
{
p = 4.8 * (1 + Math.Exp(0.02 * t));
listBox1.Items.Add("En el año " + t + " la poblacion era igual a = " + p);
}

No hay comentarios:

Publicar un comentario