jueves, 15 de octubre de 2009

PRACTICA 6 TABLA DE POBLACIONDE 1994 A 2010


PRACTICA 6 TABLA DE POBLACIONDE 1994 A 2010
CONSOLA

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace POBLACION_DE_1994_A_2010

{

class Program

{

static void Main(string[] args)

{

double T, POBLACION;

double A = 1994;

Console.WriteLine("AÑO POBLACION");

for (T = 9; T <= 25; T = T + 1)

{

POBLACION = 4.88 * (1 + Math.Exp(0.02 * T));

Console.WriteLine("{0} \t{1}", A, POBLACION);

A++;

}

Console.ReadLine();

}

}

}




VISUAL

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

namespace PRAC_6_POB_1994_A_2010_VISUAL

{

public partial class Form1 : Form

{

double T, POBLACION;

double A = 1994;

public Form1()

{

double A = 1994;

InitializeComponent();

}

private void Form1_Load(object sender, EventArgs e)

{

}

private void button1_Click(object sender, EventArgs e)

{

listBox1.Items.Add("\nAño\t\tpoblacion");

for (T = 9; T <= 25; T = T + 1)

{

POBLACION = 4.88 * (1 + Math.Exp(0.02 * T));

listBox1.Items.Add(A.ToString() + " \t " + POBLACION.ToString());

A++;

}

}

private void button2_Click(object sender, EventArgs e)

{

listBox1.Items.Clear();

}

private void button3_Click(object sender, EventArgs e)

{

Close();

}

}

}


No hay comentarios:

Publicar un comentario