예제 #1
0
    public static void Main(string[] args)
    {
        CEcuacion ec1 = new CEcuacion(5, -1.7, 2);

        double r = ec1.ValorPara(10.5);

        System.Console.WriteLine("El resultado es " + r);
    }
예제 #2
0
    public static void Main(string[] args)
    {
        CEcuacion ec1 = new CEcuacion(1, -3.2, 0, 7);

        double r = ec1.ValorPara(1);

        System.Console.WriteLine(r);

        r = ec1.ValorPara(1.5);
        System.Console.WriteLine(r);
    }
예제 #3
0
    public static void Main(string[] args)
    {
        double x, res;
        double a, b, c;

        Console.Write("Introduzca el valor de a: ");
        a = Leer.datoDouble();
        Console.Write("Introduzca el valor de b: ");
        b = Leer.datoDouble();
        Console.Write("Introduzca el valor de c: ");
        c = Leer.datoDouble();
        Console.Write("Introduzca el valor de x: ");
        x = Leer.datoDouble();

        CEcuacion ec1 = new CEcuacion(a, b, c);

        res = ec1.valorEcuacion(x);
        Console.WriteLine("Para x = " + x + ", ax^5 - bx^3 + cx - 7  =  " + res);
    }
예제 #4
0
    public static void Main(string[] args)
    {
        int    b = 0, a = 0;
        int    aux = 0;
        double x, y, suma = 0;

        do
        {
            Console.Write("Sumatorio desde a = 0 hasta b = ");
            b = Leer.datoInt();
        }while (b < 0);

        if (b < a)
        {
            aux = a;
            a   = b;
            b   = aux;
        }

        Console.WriteLine("de 1/(x + ay)");

        do
        {
            Console.Write("Introduce el valor de x: ");
            x = Leer.datoDouble();
        }while (x < 0);

        do
        {
            Console.Write("Introduce el valor de y: ");
            y = Leer.datoDouble();
        }while (y < 0);

        CEcuacion ec1 = new CEcuacion();

        for (a = 0; a <= b; a++)
        {
            ec1.establecerCoeficientes(a);
            suma += ec1.valorEcuacion(x, y);
        }

        Console.WriteLine("La suma es " + suma);
    }