Dia Mejor

Practica5_Windows

Author: Moises



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 Practica5_Windows
{
public partial class Form1 : Form
{
double t, g, d, dt;
public Form1()
{
InitializeComponent();
dt = 0.0;
g = 32.0;
listBox1.Items.Add("Tiempo Distancia actual Distancia total");
}
private void button1_Click(object sender, EventArgs e)
{
for(t=0;t<=10;t++)
{
d = 0.5 * g * t * t;
dt = dt + d;
listBox1.Items.Add(t+ "\t" + d + "\t\t" + dt);
}
}
private void button2_Click(object sender, EventArgs e)
{
listBox1.Items.Clear();
listBox1.Items.Add("Tiempo Distancia actual Distancia total");
}
private void button3_Click(object sender, EventArgs e)
{
Close();
}
}
}

 

0 Response to “Practica5_Windows”

Leave a Reply