sábado, 13 de febrero de 2010

Practica 4 "visual"

Practica 4 problema 2
codigo:
namespace practica_4_problema_2_visual
{
public partial class Form1 : Form
{
double x, y, z, w, F, f1;

public Form1()
{
InitializeComponent();
x = y = z = w = 0.0;
}

private void Form1_Load(object sender, EventArgs e)
{


}

private void button3_Click(object sender, EventArgs e)
{
Close();

}

private void button1_Click(object sender, EventArgs e)
{
x = double.Parse(textBox1.Text);
y = double.Parse(textBox2.Text);
z = double.Parse(textBox3.Text);
w = double.Parse(textBox4.Text);
f1 =4 * Math.Pow(x, 2) * Math.Pow(y, 2) * Math.Sqrt(2 * z * w);
F=Math.Pow(f1,2)/(4 * Math.Pow(x, 1.0 / 2.0));
label5.Text = ("F=" + F);


}

private void button2_Click(object sender, EventArgs e)
{
textBox1.Clear();
textBox2.Clear();
textBox3.Clear();
textBox4.Clear();
label5.Text = " ";


}
}
}


Practica 4 problema 3

codigo:
namespace Practica_4_problema_3_visual
{
public partial class Form1 : Form
{
double w, z;
public Form1()
{
InitializeComponent();
w = z = 0.0;
}

private void label1_Click(object sender, EventArgs e)
{

}

private void label2_Click(object sender, EventArgs e)
{

}

private void button1_Click(object sender, EventArgs e)
{
w = double.Parse(textBox1.Text);
z = (1.0 / Math.Sqrt(2 * Math.PI)) * Math.Exp(-w * w / 2);
label2.Text = ("z=" + z);
}

private void button2_Click(object sender, EventArgs e)
{
textBox1.Clear();
label2.Text = " ";
}

private void button3_Click(object sender, EventArgs e)
{
Close();
}

private void Form1_Load(object sender, EventArgs e)
{

}
}
}



No hay comentarios:

Publicar un comentario