viernes, 16 de octubre de 2009

PRACTICA 6.3

CONSOLA
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace practica_6._3_console
{
class Program
{
static void Main(string[] args)
{
double t, pob;
double A = 1994;
Console.WriteLine("\nAo\t\t\tpoblacion");
for (t = 9; t <= 25; t = t + 1) { pob = 4.88 * (1 + Math.Exp(0.02 * t)); Console.WriteLine("\n{0} \t\t\t{1}", A, pob); A++; } Console.ReadLine(); } } }

WINDOWS



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 practica_6._3_windows
{
public partial class Form1 : Form
{
double t, pob;
double A=1994;
public Form1()
{
double A = 1994;
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
listBox1.Items.Add("\nAo\t\tpoblacion");
for (t = 9; t <= 25; t = t + 1) { pob = 4.88 * (1 + Math.Exp(0.02 * t)); listBox1.Items.Add(A.ToString()+ "\t\t" + pob.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