Beispiel #1
0
 private void btnEjecutar_Click(object sender, EventArgs e)
 {
     Funciones.Operaciones op = new Funciones.Operaciones();
     this.txtnombre.Text = op.saludo("Saul");
     double[] x = new double[] { 10, 12, 12, 13, 15, 17 };
     this.txtresultado.Text = op.suma(x).ToString();
 }
Beispiel #2
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     Funciones.Operaciones op = new Funciones.Operaciones();
     double[] x = new double[] { 10, 20, 20, 40, 55 };
     this.lblSaludos.Text = op.Saludo(this.txtNombre.Text);
     this.txtR.Text       = op.Suma(x).ToString();
 }
Beispiel #3
0
 protected void btnMostrar_Click(object sender, EventArgs e)
 {
     Funciones.Operaciones op = new Funciones.Operaciones();
     double[] x = new double[] { 2, 3324, 3, 24, 234, 4234, 31 };
     this.lblsaludos.Text   = op.saludo(this.Txtnombre.Text);
     this.Txtresultado.Text = op.suma(x).ToString();
 }
Beispiel #4
0
        private void btnEjecutar_Click(object sender, EventArgs e)
        {
            Funciones.Operaciones op = new Funciones.Operaciones();
            this.txtNombre.Text = op.Saludo("Eduardo");

            double[] x = new double[] { 10, 11, 22, 33 };
            this.txtSuma.Text = op.Suma(x).ToString();
        }
Beispiel #5
0
        static void Main(string[] args)
        {
            Funciones.Operaciones op = new Funciones.Operaciones();
            double[] y = new double[] { 10, 12, 12, 13, 15, 17 };
            // y[0]= 12; y[1] = 22; y[2] = 100; y[3] = 20; y[4] = 33;
            double x = op.suma(y);

            Console.WriteLine(op.saludo("Saúl"));
            Console.WriteLine("La suma del array es {0}", x);
            Console.ReadKey();
        }
Beispiel #6
0
        static void Main(string[] args)
        {
            Funciones.Operaciones op = new Funciones.Operaciones();
            double[] y = new Double[] { 10, 11, 12, 13, 14, 20, 30 };//inicializar valor
            //y[0] = 12; y[1] = 22; y[2] = 100; y[3] = 20; y[4] = 33;

            double x = op.Suma(y);

            Console.WriteLine(op.Saludo("Michael"));
            Console.WriteLine("la suma del array es : {0}", x);
            Console.ReadKey();
        }
Beispiel #7
0
        static void Main(string[] args)
        {
            Funciones.Operaciones op = new Funciones.Operaciones();
            double[] y = new Double[] { 10, 11, 12, 13, 14, 20, 30 };

            /*y[0] = 12;
            *  y[1] = 22;
            *  y[2] = 100;
            *  y[3] = 20;
            *  y[4] = 33;*/
            double x = op.Suma(y);

            Console.WriteLine("La suma del array es: {0}", x);
            Console.ReadKey();
        }
Beispiel #8
0
        public void TestPromedio()
        {
            //Arrange
            int[] array_odd = new int[5] {
                1, 2, 3, 4, 5
            };
            int[] array_even = new int[6] {
                6, 5, 4, 3, 2, 1
            };

            double odd_expected  = 3;
            double even_expected = 3.5;

            Funciones.Operaciones calcula = new Funciones.Operaciones();

            //Act
            double odd_actual  = calcula.Promedio(array_odd);
            double even_actual = calcula.Promedio(array_even);

            //Asserts
            Assert.AreEqual(odd_expected, odd_actual, 0.001, "Error en promedio Impar");
            Assert.AreEqual(even_expected, even_actual, 0.001, "Error en promedio Par");
        }
Beispiel #9
0
        public void TestMedia()
        {
            //Arrange
            int[] array_odd = new int[5] {
                10, 20, 30, 40, 50
            };
            int[] array_even = new int[6] {
                60, 50, 40, 30, 20, 10
            };

            double odd_expected  = 30;
            double even_expected = 35;

            Funciones.Operaciones calcula = new Funciones.Operaciones();

            //Act
            double odd_actual  = calcula.Media(array_odd);
            double even_actual = calcula.Media(array_even);

            //Asserts
            Assert.AreEqual(odd_expected, odd_actual, 0.001, "Error en Media Impar");
            Assert.AreEqual(even_expected, even_actual, 0.001, "Error en Media Par");
        }
Beispiel #10
0
        public void TestDesviacionEstandar()
        {
            //Arrange
            int[] array_odd = new int[5] {
                600, 470, 170, 430, 300
            };
            int[] array_even = new int[6] {
                10, 32, 24, 26, 40, 30
            };

            double odd_expected  = 147;
            double even_expected = 9.09;

            Funciones.Operaciones calcula = new Funciones.Operaciones();

            //Act
            double odd_actual  = calcula.DesviacionEstandar(array_odd);
            double even_actual = calcula.DesviacionEstandar(array_even);

            //Asserts
            Assert.AreEqual(odd_expected, odd_actual, 0.5, "Error en Desviacion Estandar Impar");
            Assert.AreEqual(even_expected, even_actual, 0.5, "Error en Desviacion Estandar Par");
        }