sábado, 13 de febrero de 2010

Practica 4 "En consola"

Practica 4 problema 2

codigo:
namespace practica_4_problema_2
{
class Program
{
static void Main(string[] args)
{
double x, y, z, w, F, T1, T2, T3, T4;
Console.WriteLine("introduce valor de x,y,z,w");
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();

}
}
}




Practica 4 problema 3
codigo:
namespace Practica_4_problema_3
{
class Program
{
static void Main(string[] args)
{
double w, z;
Console.Write("introduce el valor w=");
w=double.Parse(Console.ReadLine());
z = (1.0 / Math.Sqrt(2 * Math.PI)) * Math.Exp(-w * w / 2);
Console.Write("z=" + z);
Console.ReadKey();
}
}
}

No hay comentarios:

Publicar un comentario