Beispiel #1
0
        private void btnMostrar_Click(object sender, EventArgs e)
        {
            try
            {
                string nuevonombre = BibliotecaPractica.Clase1.Nombre();
                txtbNombre.Text = nuevonombre;

                string cuenta = Clase1.NumeroCuenta();
                txtbNumCuenta.Text = cuenta;

                float promediofinal = Clase1.PromedioAlumno(int.Parse(txtbCal1.Text), int.Parse(txtbCal2.Text), int.Parse(txtbCal3.Text), 1);
                txtbPromedio.Text = promediofinal.ToString();

                int sumafinal = Clase2.Suma(int.Parse(txtbCal1.Text), int.Parse(txtbCal2.Text), int.Parse(txtbCal3.Text));
                txtbSuma.Text = sumafinal.ToString();

                string situacion = Clase2.AlumnoRegular();
                txtbSitAcademica.Text = situacion;
            }

            catch
            {
                MessageBox.Show("Ingresa todas las calificaciones");
            }
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            Clase1 obj = new Clase1();

            namespacesAnidados.LasClases.Clase2 ob2 = new namespacesAnidados.LasClases.Clase2();
            Console.ReadKey();
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            string texto  = "20";
            string texto2 = "30";

            Debug.WriteLine(texto + texto2);

            // convertir un valor.
            // texto en un numero (puede fallar)
            int numero1 = Convert.ToInt32(texto);
            int numero2 = Int32.Parse(texto2);

            Debug.WriteLine(numero1 + numero2);


            // numero a texto (no falla)
            texto  = numero1.ToString();
            texto2 = numero2.ToString();

            // primitivo
            object numero3 = 20;

            Debug.WriteLine(numero3);

            // CAST! no hace conversion
            int numero = 20;

            object obj = new Clase1();

            ((Clase1)obj).CampoComun = "2";
            ((Clase1)obj).Campo1     = "22";
            obj = "22";
            obj = new Clase2();
            // 20.2
            // 20.2f
            // 20.2d
            ((Clase1)obj).Campo1 = "22";
        }
Beispiel #4
0
 public static void Main(string[] args)
 {
     Clase1 objC1 = new Clase1();
     Clase2 objC2 = new Clase2();
 }