materiales

parcial 3

nacho  programación   nacho binario      

apuntadores






clases


diagramas de flujo                 programa mcd        mcd2  (código)

Visual C# .NET



Introducción al lenguaje C# y .NET Framework



C# Ya




            Fundamentos de C# para absolutos principiantes



                      Curso de Iniciación a C#


manejo de arreglos

multiplica una matriz por un número

interfase




código


salida



código

            double[,] dato;
            dato = new double[2, 2];
            dato[0, 0] = Convert.ToDouble(textBox1.Text);
            dato[0, 1] = Convert.ToDouble(textBox2.Text);
            dato[1, 0] = Convert.ToDouble(textBox3.Text);
            dato[1, 1] = Convert.ToDouble(textBox4.Text);
            string valor = comboBox1.SelectedItem.ToString();
            double x = Convert.ToDouble(valor);
            textBox5.Text = Convert.ToString(dato[0, 0] * x);
            textBox6.Text = Convert.ToString(dato[0, 1] * x);
            textBox7.Text = Convert.ToString(dato[1, 0] * x);
            textBox8.Text = Convert.ToString(dato[1, 1] * x);

Referencia
        arrays

            métodos


números aleatorios







            Random rnd = new Random();
            int[] valores;
            valores = new int[100];
            for (int i = 0; i <= 10; i++)
            {
                int a = rnd.Next(0, 99);
                listBox1.Items.Add(Convert.ToString(a));
                valores[a] = a;
            }
            for (int i = 0; i < 100; i++)
            {
                if (valores[i] > 0)
                {
                 
                    listBox2.Items.Add(Convert.ToString(i));
                }

            }



uso de funciones (nacho 5.3)

        public void button1_Click(object sender, EventArgs e)
        {
            float x; x = 5.1f;
            float y; y = 2.3f;
            escribeNumeroReal(x,y);
        }

        public  void escribeNumeroReal(float m, float n)
        {
            textBox1.Text =m.ToString("#.###");
            textBox2.Text =n.ToString("#.###");
        }
    }



uso de funciones (cuadrado de un número)

            int x; x = Convert.ToInt16(textBox1.Text);
            int res = cuadrado(x);
            textBox2.Text = res.ToString();
           }
        public static int cuadrado(int n)
        {

            return n * n;
        }


















3 comentarios:

  1. http://www.bloginformatico.com/la-compilacion-y-sus-fases-o-etapas.php

    ResponderEliminar
  2. double resultado = sumar(10, 3.1416);
    label2.Text = resultado.ToString();
    }
    double sumar(int alfa, double beta)
    {
    return alfa + beta;
    }

    ResponderEliminar
  3. Este comentario ha sido eliminado por el autor.

    ResponderEliminar