{
public partial class Form1 : Form
{
double x, y, z, w, F, T1, T2, T3, T4;
public Form1()
{
InitializeComponent();
x = 0.0;
y = 0.0;
z = 0.0;
w = 0.0;
F = 0.0;
}
private void Form1_Load(object sender, EventArgs e)
{
}
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);
T1 = 4 * Math.Pow(x, 2) * Math.Pow(y, 2);
T2 = Math.Sqrt(2 * z * w);
T3 = 4 * Math.Pow(x, (1.0 / 2.0));
T4 = T1 * T2;
F= Math.Pow (T4,2) / T3;
label5.Text="Ecuacion es:" + F;
}
private void button2_Click(object sender, EventArgs e)
{
textBox1.Clear();
textBox1.Focus();
textBox2.Clear();
textBox3.Clear();
textBox4.Clear();
label5.Text = "";
}
private void button3_Click(object sender, EventArgs e)
{
Close();
}
}
}
namespace practica4_2C
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Introduce el valor x,y,z,w:");
double x,y,z,w,F,T1,T2,T3,T4;
Console.Write("x=");
x = double.Parse(Console.ReadLine());
Console.Write("y=");
y = double.Parse(Console.ReadLine());
Console.Write("z=");
z = double.Parse(Console.ReadLine());
Console.Write("w=");
w = double.Parse(Console.ReadLine());
T1 = 4 * Math.Pow(x, 2) * Math.Pow(y, 2);
T2 = Math.Sqrt(2 * z * w);
T3 = 4 * Math.Pow(x, 1.0 / 2.0);
T4 = T1 * T2;
F = Math.Pow(T4, 2) / T3;
Console.WriteLine("F=" + F);
Console.ReadKey();
}
}
}


No hay comentarios:
Publicar un comentario